Pattern Recognition Drill
Easy Sorting
The Problem
Merge two sorted arrays into one sorted array.
What approach would you use?
Think about it before scrolling down.
One pointer per array, always pick the smaller front element. O(n+m).
Common Trap
Concatenate + re-sort is O((n+m) log(n+m)). Merge is O(n+m) — exploit the sorted property.