Leetcode Problems Two Sum Solution Javascript Array Length