Latest Articles

Discover our latest posts and insights from the Kode$word journey

The Voltage Regulator Problem: Find The Longest Stable Subarray With One Change – Java Solution

The Voltage Regulator Problem: Find The Longest Stable Subarray With One Change – Java Solution

Learn to solve a custom sliding window problem in Java by finding the longest contiguous group whose voltage range can be fixed using one adjustment. Includes intuition, examples, Java code, and practice test cases.

Krishna Shrivastava
Oct 29, 2026
JavaSliding WindowArraysTreeMapDSA
Read More
LeetCode 3963: Create Grid With Exactly One Path — The Simple Java Trick I Almost Overlooked

LeetCode 3963: Create Grid With Exactly One Path — The Simple Java Trick I Almost Overlooked

Learn how to solve LeetCode 3963, Create Grid With Exactly One Path, using a simple Java construction. Discover how moving right first and down later creates exactly one valid path without complex algorithms.

Krishna Shrivastava
Oct 27, 2026
LeetCodeJavaMatrixEasy
Read More
LeetCode 1254: Number of Closed Islands — Finding the Idea Before Writing the Code (Java)

LeetCode 1254: Number of Closed Islands — Finding the Idea Before Writing the Code (Java)

Struggling with LeetCode 1254 Number of Closed Islands? Follow a beginner-friendly journey from understanding a grid to discovering recursion, DFS, and how to count islands completely surrounded by water in Java.

Krishna Shrivastava
Oct 25, 2026
LeetCodeJavaRecursionBacktrackingMatrixDFSMedium
Read More
LeetCode 17: Letter Combinations of a Phone Number — Java Solution and Backtracking Explained

LeetCode 17: Letter Combinations of a Phone Number — Java Solution and Backtracking Explained

Learn how to solve LeetCode 17, Letter Combinations of a Phone Number, using Java recursion and backtracking. Includes keypad mapping, a step-by-step dry run, code explanation, and complexity analysis.

Krishna Shrivastava
Oct 19, 2026
LeetCodeJavaBacktrackingRecursionStringArrayListDSAMediumCombination
Read More
LeetCode 2089: Find Target Indices After Sorting Array – Java Solution & Explanation

LeetCode 2089: Find Target Indices After Sorting Array – Java Solution & Explanation

Solve LeetCode 2089 in Java using array sorting and linear traversal. Includes the problem link, Java code, a step-by-step dry run, and time and space complexity.

Krishna Shrivastava
Oct 19, 2026
LeetCodeJavaArraysSortingLinear SearchDSAEasy
Read More
LeetCode 1569: Number of Ways to Reorder Array to Get Same BST – Java Solution & Explanation

LeetCode 1569: Number of Ways to Reorder Array to Get Same BST – Java Solution & Explanation

Solve LeetCode 1569 in Java using BST recursion, nCr combinations, and Pascal’s Triangle. Understand subtree interleavings, the modulo calculation, and a step-by-step dry run.

Krishna Shrivastava
Oct 18, 2026
LeetCodeJavaBinary Search TreeBSTRecursionCombinatoricsPascal TriangleDynamic ProgrammingDSAHard
Read More
LeetCode 2913: Subarrays Distinct Element Sum of Squares I – Java Solutions & Explanation

LeetCode 2913: Subarrays Distinct Element Sum of Squares I – Java Solutions & Explanation

Learn how to calculate the sum of squared distinct counts across all subarrays using Java, HashSet, and nested loops, with two approaches and a step-by-step dry run.

Krishna Shrivastava
Oct 15, 2026
LeetCodeJavaArraysHashSetSubarraysBrute ForceEasy
Read More
LeetCode 3727 Maximum Alternating Sum of Squares – Java Solution & Explanation

LeetCode 3727 Maximum Alternating Sum of Squares – Java Solution & Explanation

Learn how to maximize the alternating sum of squared array elements using sorting and greedy rearrangement in Java, with a practical lesson about debugging Time Limit Exceeded errors.

Krishna Shrivastava
Oct 13, 2026
LeetCodeJavaArraysSortingMedium
Read More
LeetCode 1614 Maximum Nesting Depth of the Parentheses – Java Solution & Explanation

LeetCode 1614 Maximum Nesting Depth of the Parentheses – Java Solution & Explanation

Find the maximum number of nested parentheses in a valid expression using a simple counter and one pass through the string.

Krishna Shrivastava
Sep 28, 2026
LeetCodeJavaParenthesesStringsEasy
Read More
Page 1 of 20 • 179 articles total
Ai Assistant Kas