Shortest Path Problem Leetcode Python Easy Drawing Step