Leetcode Shortest Path Problem Solver