[BSSD] 忍不住抱怨一下# Parenting - 为人父母
c*a
1 楼
careercup看到A家的题
An operation "swap" means removing an element from the array and appending
it at the back of the same array. Find the minimum number of "swaps" needed
to sort that array.
Eg :- 3124
Output: 2 (3124->1243->1234)
How to do it less than O(n^2) ?
An operation "swap" means removing an element from the array and appending
it at the back of the same array. Find the minimum number of "swaps" needed
to sort that array.
Eg :- 3124
Output: 2 (3124->1243->1234)
How to do it less than O(n^2) ?