DSAMediumArrays
Merge Two Sorted Arrays
đ Problem
Given two sorted arrays, merge them into a single sorted array.
đ§ Approach
Use two pointers, one for each array, starting at index 0. Compare the elements the pointers point to, copy the smaller one into the result array, and advance that pointer. Repeat until one array is exhausted, then copy any remaining elements from the other array directly (since they're already sorted).