Shortest Path Algorithm Leetcode Sql