Ma Leetcode Solution Javascript Interview