Software Engineer's Blog

Blog posts — page 25

15. 3Sum

Coding Interview

15. 3Sum

Jason Yang · 27 Mar, 2026

3Sum (LeetCode 15): sort then two-pointer for an O(n^2) solution, why sorting unlocks it, and the three places duplicate triplets sneak in — with an interactive visualization.

11. Container With Most Water

Coding Interview

11. Container With Most Water

Jason Yang · 27 Mar, 2026

Container With Most Water (LeetCode 11): the two-pointer O(n) approach, and the short proof for why moving the shorter line never skips a better answer — with an interactive visualization.

The Two Pointers Pattern, Explained with Java

Coding Interview

The Two Pointers Pattern, Explained with Java

Jason Yang · 27 Mar, 2026

The two-pointer pattern in Java: how converging pointers turn an O(n²) brute force into a single O(n) pass, and the decision rule that makes it safe.