leetcode.com 2026-11-21
🟡3331.find-subtree-sizes-after-changes
🏷️ Tags
#tree #depth_first_search #array #hash_table #string
🟡3331.find-subtree-sizes-after-changes
🏷️ Tags
#tree #depth_first_search #array #hash_table #string
Telegraph
find-subtree-sizes-after-changes
You are given a tree rooted at node 0 that consists of n nodes numbered from 0 to n - 1. The tree is represented by an array parent of size n, where parent[i] is the parent of node i. Since node 0 is the root, parent[0] == -1. You are also given a string…