Trees find sum at level K

What are the total number of inputs?It has not been specified?

hello @aryamaan1011
yeah total number of input is not specified .
you need to write a recursive to build tree recursively.
every line of input will contain 2 things 1st data , 2nd is number of children.

if number of children is zero then simply return the current node.
if number of child is one then recusively build left subree , assign null to right subtree and return.
otherwise recusively build both left and right subtree and return current node.
check this->
image

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.