Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2737. Find the Closest Marked Node
Given an undirected tree (or graph) where nodes can be toggled "marked," support operations that mark/unmark nodes and queries that ask for the shortest distance from a given node to the nearest marked node. The challenge is to answer many dynamic distance queries efficiently (better than recomputing BFS from scratch), typically requiring multi-source shortest-path ideas or tree decomposition/centroid techniques.
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.