shortest path between two nodes leetcode