I got a question which how many times you swap to get sorted array.
I thought was merge sort and waste time there. And bubble sort kind solved the issue but time limited exceeded.
[4,3,5,2,6] - > [2,3,4,5,6] how many swaps.
Too bad I waste so much time on the wrong approach. Anyone has optimized solution?