3319. K-th Largest Perfect Subtree Size in Binary Tree
You are given the
root
of a binary tree and an integerk
.Return an integer denoting the size of the
kth
largest perfect binary subtree, or-1
if it doesn’t exist.A perfect binary tree is a tree where all leaves are on the same level, and every parent has two children.
A subtree of
treeName
is a tree consisting of a node intreeName
and all of its descendants.