Solve The Two Sum Problem In Javascript