How to efficiently sort a pivoted array
Anonymous
1. Find the pivot. 2. Reverse the left side until the pivot. 3. Reverse the right side after pivot. 4. Reverser the whole array. No need for extra storage and it's still O(n).
Check out your Company Bowl for anonymous work chats.