row of '1' (a full box) and '0' (an empty one).
In one move you may swap two **adjacent** boxes. Find the fewest moves after which every empty box is on the left and every full box is on the right.row="0101" → 1
Swap the boxes at indices 1 and 2 to get "0011". One move is enough.
row="1100" → 4
Each full box has to get past both empty ones: 2 + 2 = 4 moves.
row="000" → 0
row is '0' or '1'row="0101"
1
Run checks the first 3 tests in your browser. Submit checks all 155 tests on the server, hidden ones included.