Output always remain 0


this is the code
the output always remain zero
can you please help me correct the code?

Hello @prerna_gupta31 could you please explain your logic here so that i can help you in the better manner.

Firstly, I am building the tree recursively if n=2 then it will have both left child and right child. After that the function sumatk function is to compute the sum at kth level. And variable sum is defined globally

I found the mistake… thank you

@prerna_gupta31 if your doubt is cleared you can mark this doubt as resolved.
Happy learning!!