0

How many swaps do I need to sort a list?
code-golfarray-manipulationsorting
A swap is defined as an operation on a list that exchanges the position of exactly two elements:
[9, 1, 3, 4, 0, 0, 3, 7, 9, 1, 4, 4, 8, 7, 3, 9, 4, 7, 0, 1]
| <----------------> |
[9, 1, 1, 4, 0, 0, 3, 7, 9, 3,...