Shortest Path Algorithm Leetcode Python Beginner Problems