Leetcode javascript