1963. Minimum Number of Swaps to Make the String Balanced
Description
**Input:** s = "][]["
**Output:** 1
**Explanation:** You can make the string balanced by swapping index 0 with index 3.
The resulting string is "[[]]".**Input:** s = "]]][[["
**Output:** 2
**Explanation:** You can do the following to make the string balanced:
- Swap index 0 with index 4. s = "[]][][".
- Swap index 1 with index 5. s = "[[][]]".
The resulting string is "[[][]]".ac
Previous1962. Remove Stones to Minimize the TotalNext1964. Find the Longest Valid Obstacle Course at Each Position
Last updated