Javascript Practice Questions Leetcode Two