Can anyone tell me how to solve this problem.
question link - CodeChef: Practical coding for everyone
thankyou.
Can anyone tell me how to solve this problem.
question link - CodeChef: Practical coding for everyone
thankyou.
Hello @silent_killer1 .
We will be uploading the editorials soon.
But since you requesting. The problem can be solved using Lowest Common Ancestor ( LCA).