Problem Description
Loading...
Problem Analysis
When finding the parent node, add 1 to the parent node’s level
This way, the ran array can store how many people are below it
Finally, just count the number of entries where ran[i]==k
cpp
| |
When finding the parent node, add 1 to the parent node’s level
This way, the ran array can store how many people are below it
Finally, just count the number of entries where ran[i]==k
| |
Loading...