How is it working of even as well as odd


Don’t we have to apply an extra if condition like this one?

hey, ur code is working fine and passing all test cases… what doubt are u facing??

sir, look at the code I have shared

how is this code working for even no of nodes as well as odd no of nodes?

sry but I didnt get ur doubt… ur code is absolutely fine…

I have explained my doubt in this https://ide.codingblocks.com/s/654886 please look

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.