Balancing Parentheses Leetcode Problems Javascript Code