Distance Between Two Nodes in a Tree
Medium
Binary Lifting & LCA
Given an unweighted tree rooted at node 1, answer q queries for the number of edges on the path between u and v.
Constraints
1 <= n, q <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.