Largest Proper Subtree — Solution & Editorial
Compute subtree sizes bottom-up (post-order over a BFS order works iteratively) and take the maximum over non-root nodes.
Complexity: O(N)
Compute subtree sizes bottom-up (post-order over a BFS order works iteratively) and take the maximum over non-root nodes.
Complexity: O(N)