Shortest Source To Destination Path Leetcode Javascript