Available question text
Given an undirected tree and a set of restricted (blocked) nodes, count how many nodes are reachable from node 0 without visiting any restricted node by traversing the tree while skipping blocked nodes. Constraints: tree of up to 1e5 nodes, edges form a valid tree so a single DFS/BFS traversal suffices.
Related questions
Continue with questions that share topics or the same question type.
- Reachable Nodes In Subdivided Graph
Coding
- Add Edges to Make Degrees of All Nodes Even
Coding
- All Nodes Distance K in Binary Tree
Coding · Binary Tree · Breadth-First Search · Depth-First Search
- Binary Tree Nodes
Coding
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 2368. Reachable Nodes With Restrictions
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source