Pattern Recognition Drill
Easy Arrays & Strings
The Problem
Given sorted arrays a and b, return a single merged 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) time.
Concatenate and sort: O((n+m) log(n+m)). Works but ignores that inputs are already sorted.
Common Trap
Don't re-sort — the merge step is the whole point. Interviewers test if you exploit sorted order.