← ALL NOTES
Array

3532. Path Existence Queries in a Graph I

Given a graph of n nodes (0..n−1) and an array nums of length n, sorted non-decreasing. There's an edge between nodes i and j if |nums[i]−nums[j]| ≤ maxDiff. For each query [u,v], determine whether a…

Loading…