Shortest Path Problem Leetcode Python Programs