Minimum Bracket Reversal Leetcode