Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3532. Path Existence Queries in a Graph I
Given sorted values nums and a threshold maxDiff, determine for each query whether two node indices lie in the same connected component of an undirected graph where an edge exists between any pair whose values differ by at most maxDiff. This reduces to grouping indices into contiguous components (or using a disjoint-set) based on adjacent value differences ≤ maxDiff and checking if u and v share a component.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.