Shortest Path Algorithm Leetcode 75