Shortest Path Problem Leetcode Premium