Approach hintTry it first, then revealHide
Implement merge sort: sort each half recursively, then merge the two sorted halves with two pointers into a buffer. It guarantees O(n log n) whatever the input order.
Implement merge sort: sort each half recursively, then merge the two sorted halves with two pointers into a buffer. It guarantees O(n log n) whatever the input order.