Problem 3319 · Medium

K-th Largest Perfect Subtree Size in Binary Tree

Measure each subtree bottom-up, record the sizes of perfect subtrees, and read the k-th largest.

Open the interactive visualisation