Shortest Path Problem Leetcode Python Challenges