Two Sum Two Leetcode Javascript Questions