0
Q:

Minimum Swaps for Bracket Balancing

Input  : []][][
Output : 2
First swap: Position 3 and 4
[][]][
Second swap: Position 5 and 6
[][][]

Input  : [[][]]
Output : 0
The string is already balanced.

0

New to Communities?

Join the community