All Posts

1276 articles

dsa2 min read

Merge K Sorted Lists

Merge K sorted linked lists into one sorted list using a min-heap to always extract the globally smallest node.

Read →
dsa2 min read

Find K Pairs with Smallest Sums

Find K pairs (u, v) with smallest sums from two sorted arrays using a min-heap initialized with first row candidates.

Read →
dsa2 min read

Ugly Number II

Find the nth ugly number (only prime factors 2, 3, 5) using three pointers for the 2x, 3x, 5x merge streams.

Read →
dsa2 min read

Course Schedule III

Maximize courses taken within deadlines by greedily scheduling and swapping out the longest past course.

Read →
Page 69 of 256