Hello guys , I am having trouble solving this problem
You can read problem statement here also.
You are playing a game consisting of n planets. Each planet has a teleporter to another planet (or the planet itself). Your task is to process q queries of the form: when you begin on planet x and travel through k teleporters, which planet will you reach? n , q can be upto 2.10^5. k can be upto 10^9.
So , any hint to solve this problem will be grateful.
Thanks in advance :)