Tree-Find sum at level k


My code is giving run error for 3 test cases, help needed

Hey Amrut, your line 47 is causing runtime error!
what if root->left or root->right is null? (you are accessing root->left->data which become NULL->data!)