Available question text
Count how many subsets of branches can be closed so that every pair of remaining branches has weighted shortest-path distance ≤ maxDistance (empty or single-node sets count). Algorithmically this requires computing all-pairs shortest paths and then counting subsets of nodes whose pairwise distances all meet the threshold — equivalently counting cliques in the threshold graph defined by dist(u,v) ≤ maxDistance.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2959. Number of Possible Sets of Closing Branches
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source