Problem 1963 · Medium

Minimum Number of Swaps to Make the String Balanced

Find the fewest swaps needed to turn a bracket string into a balanced one. The visual tracks the running balance and marks where it dips below zero.

Open the interactive visualisation