Problem 2134 · Medium

Minimum Swaps to Group All 1's Together II

Group all ones into one circular block using the fewest arbitrary swaps.

Open the interactive visualisation