Minimum Swaps to Move Zeros to End
Zeros must end up in the last slots. Pair each misplaced zero in the front with a misplaced value in the back, one swap per pair.
Zeros must end up in the last slots. Pair each misplaced zero in the front with a misplaced value in the back, one swap per pair.