Two Sum Javascript Leetcode Questions