Bracket Matching Leetcode Javascript Interview