Encoding April 2019


#1

Can anyone tell me how to solve this problem.
question link - https://www.codechef.com/AVEN2019/problems/AVN009

thankyou.


#2

Hello @silent_killer1 .
We will be uploading the editorials soon.
But since you requesting. The problem can be solved using Lowest Common Ancestor ( LCA).