Help me out in this problem


@KartikKhariwal are u there ?

yes…wait…

@Kartikkhariwal1 how much time more you will take ?

Bro sometimes it takes time to debug code ,have some patience.

@Kartikkhariwal1 okay bro

Hey @shivammishra20121999
I am not able to debug ur code
Here added 2 cout statements in ur code for debugging


I am not able to understnad how its receiving 2 from l for that input (see input in that link)

If u are able to uunderstand that then let me know and I will try my best to help u out :slight_smile:

Hey @shivammishra20121999

   int l=longest(root->left);
    int r=longest(root->right);

u made call to wrong function

If u dont have any other doubt in this then please hit a like and mark this as resolved :).

1 Like

@Kartikkhariwal1 already done bro

@shivammishra20121999

is ur doubt resolved?