Leetcode Two Sum Problem In Javascript Code