Shortest Path Algorithm Leetcode Two Sigma