Leetcode Javascript Practice