Coding Interview
139. Word Break
Jason Yang · 04 Aug, 2026
Word Break (LeetCode 139): why a greedy longest-match fails, how prefix DP with dp[i] = 'is s[0..i) segmentable' fixes it, and the prefix-DP Java solution.
Coding Interview
Jason Yang · 04 Aug, 2026
Word Break (LeetCode 139): why a greedy longest-match fails, how prefix DP with dp[i] = 'is s[0..i) segmentable' fixes it, and the prefix-DP Java solution.
Coding Interview
Jason Yang · 04 Aug, 2026
Clone Graph (LeetCode 133): why a single HashMap from original to copy solves cycles and shared neighbors at once, with a clean DFS solution in Java.
Coding Interview
Jason Yang · 04 Aug, 2026
Binary Tree Maximum Path Sum (LeetCode 124): why one DFS returns a single-branch gain to the parent while tracking a global best that bends through a node.
Coding Interview
Jason Yang · 04 Aug, 2026
Construct Binary Tree from Preorder and Inorder Traversal (LeetCode 105): why preorder hands you the root and inorder splits left from right, in O(n) Java.
Coding Interview
Jason Yang · 04 Aug, 2026
Maximum Depth of Binary Tree (LeetCode 104): the one-line DFS recurrence, why depth is 1 + the taller subtree, and a BFS alternative in Java.