Why showing wrong answer

What’s wrong here in my code…


Why it is showing wrong answer…

hello @ashishnnnnn
image

put them outside ur if statement.
the condition that u have mentioned should be only on current node.

check ur updated code here->

Thanks… I got it where i was doing wrong…