Software Engineer's Blog

Blog posts — page 8

139. Word Break

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.

133. Clone Graph

Coding Interview

133. Clone Graph

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.

124. Binary Tree Maximum Path Sum

Coding Interview

124. Binary Tree Maximum Path Sum

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.

104. Maximum Depth of Binary Tree

Coding Interview

104. Maximum Depth of Binary Tree

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.