Concept Flow - Merge Two Sorted Arrays Without Extra Space
Start with two sorted arrays A and B
Compare last element of A with first element of B
If A's last > B's first?
Swap A's last and B's first
Sort array B to keep it sorted
Repeat until no swaps needed
Done: Both arrays sorted, merged without extra space
We repeatedly swap the largest element of the first array with the smallest element of the second array if needed, then sort the second array to maintain order, until both arrays are merged in sorted order without extra space.
