Please tell me how to get the count of beautiful vertices

(as the coding blocks ide was not saving my code and also not generating its link i have to shift to another one)

i have written the code to update the children array but i am not able to get the count of the beautiful vertices pls help

have replied to your previous doubt.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.