Leetcode javascript 30 days challenge