expect answer is 4
but it's not 6?
or the tree is built in another way?
I guess you don't know what leaves are?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.