Leetcode Problems Two Sum Solution Javascript Substring