Two Sum Two Leetcode Javascript Question