Problem 3781 · Medium

Maximum Score After Binary Swaps

Ones can only move left in order, so a table of best scores over each reachable target position finds the maximum.

Open the interactive visualisation