Loading problem…
An undirected graph has n nodes labeled 0 through n - 1. Each edge [u, v, length] joins two nodes. Multiple edges between the same nodes are allowed, and the graph may be disconnected.
For each query [p, q, limit], determine whether p and q are connected by a path whose every edge has length strictly less than limit. The condition applies to each edge, not the sum of the path lengths. Return one boolean per query in the original query order. Do not modify edgeList or queries.
Example 1:
Example 2:
Example 3: