Available question text
Given an even-length string with equal numbers of '[' and ']', compute the minimum number of swaps of any two characters needed to transform it into a balanced bracket sequence. The core challenge is to greedily track running balance and fix negative imbalances (consecutive excess ']') with the fewest pairwise swaps.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1963. Minimum Number of Swaps to Make the String Balanced
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source