Subtree Sum Queries
Medium
Euler Tour & Subtree Queries
A tree with n nodes is rooted at node 1 and every node has a value. For each query node x print the sum of values in the subtree of x.
Constraints
1 <= n, q <= 10^5 |value| <= 10^4
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.