Getting run time error in my code
Hi @sharad1103
You are getting run error because when root==NULL you are trying to access root->left and root->right.
So you need to just make a single change in sumAtLevelK function that is include the case when root==NULL and return 0 for that.
Here is your corrected code :
Mark your doubt as resolved if your doubt is cleared.