A string of '(' and ')' must become balanced. Adding, removing or flipping a bracket each costs 1 — return a balanced result reached at the lowest cost.
A string of '(' and ')' must become balanced. Adding, removing or flipping a bracket each costs 1 — return a balanced result reached at the lowest cost.
Opens with the full question.