Shortest Path Algorithm Leetcode Two Sum Problem Using Hashmap