Software Engineer's Blog

Blog posts — page 7

200. Number of Islands

Coding Interview

200. Number of Islands

Jason Yang · 04 Aug, 2026

Number of Islands (LeetCode 200): count connected land groups with a DFS flood fill that sinks each island as it's found, in clean idiomatic Java.

191. Number of 1 Bits

Coding Interview

191. Number of 1 Bits

Jason Yang · 04 Aug, 2026

Number of 1 Bits (LeetCode 191): counting set bits with a plain shift loop, then Brian Kernighan's n & (n-1) trick that only loops once per set bit — in Java.

190. Reverse Bits

Coding Interview

190. Reverse Bits

Jason Yang · 04 Aug, 2026

Reverse Bits (LeetCode 190): peel the low bit, stack it onto the result 32 times, and the >>> vs >> shift nuance in Java. Plus the byte-cache follow-up.

143. Reorder List

Coding Interview

143. Reorder List

Jason Yang · 04 Aug, 2026

Reorder List (LeetCode 143): interleave a linked list front-to-back in O(1) space by combining three classic pointer moves — find the middle, reverse, merge.

141. Linked List Cycle

Coding Interview

141. Linked List Cycle

Jason Yang · 04 Aug, 2026

Linked List Cycle (LeetCode 141): why two pointers moving at different speeds must collide inside a loop, and the O(1)-space Floyd's algorithm in Java.