Trees - Sum at level k

First 3 test cases show runtime error .
plz check the code and do the changes and let me know the mistake.

problem : https://online.codingblocks.com/app/player/39658/content/55448/4764/code-challenge?code=DKfh10P6QxGRYhBLVsqZjsBwjIV9lmDf

mycode : https://ide.codingblocks.com/s/192781

plz reply asap

Hey problem link you provided is not accessible to anyone else except you.

@sengarankit98 you are missing a base case in the function called to calculate sum.
if(root==NULL)
return ;
Add this base case at the starting of function and it would work.
If this resolves your doubt mark it as resolved.

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.