Path Existence Queries in a Graph II
Two nodes share an edge when their values differ by at most maxDiff. For each query, find the fewest edges between two nodes, or -1 if they are not connected.
Two nodes share an edge when their values differ by at most maxDiff. For each query, find the fewest edges between two nodes, or -1 if they are not connected.