Software Engineer's Blog

Blog posts — page 11

54. Spiral Matrix

Coding Interview

54. Spiral Matrix

Jason Yang · 04 Aug, 2026

Spiral Matrix (LeetCode 54): walk the grid clockwise by tracking four edges and peeling one row or column off after each pass — clean Java, no visited set.

49. Group Anagrams

Coding Interview

49. Group Anagrams

Jason Yang · 04 Aug, 2026

Group Anagrams (LeetCode 49): pick a canonical key so every anagram hashes to the same bucket. Sorted-key vs count-array key in Java, with complexity.

48. Rotate Image

Coding Interview

48. Rotate Image

Jason Yang · 04 Aug, 2026

Rotate Image (LeetCode 48): why transpose-then-reverse rotates a matrix 90° clockwise in place, with the O(1)-space Java solution and the index math behind it.

39. Combination Sum

Coding Interview

39. Combination Sum

Jason Yang · 04 Aug, 2026

Combination Sum (LeetCode 39): why passing the same start index lets you reuse numbers, plus a sorted-and-pruned backtracking solution in Java.

23. Merge k Sorted Lists

Coding Interview

23. Merge k Sorted Lists

Jason Yang · 04 Aug, 2026

Merge k Sorted Lists (LeetCode 23): why merging one list at a time is O(n·k), and how a min-heap or pairwise merging cuts it to O(n log k) in Java.