Shortest Path Algorithm Leetcode Python Challenges Using Tuples