Problem: Subordinates (CSES) Task: You have a company with employees. Each employee except the boss has one direct manager. For each employee, count how many subordinates they have (including indirect subordinates).
This is a subtree size problem. If you root the tree at the boss, the number of subordinates of a node is the size of its subtree minus (itself). Compute subtree sizes with a single DFS traversal: the size of a node equals plus the sum of sizes of all its children.