Two Sum Problem In Javascript