Getting tle in submission

I am doing this question from codeforces…
https://codeforces.com/problemset/problem/1355/B
This is the code… I have written…
https://codeforces.com/contest/1355/submission/96854122
But i am not able to get… why it is showing TLE…

Hey @ashishnnnnn
Why giving TLE ?

while(arr[i]+i<=n){
            tt++;
            i = i+arr[i];
        } 

Here assume test case
was
1
1
1
i.e 1 eplorerer now when u do i=i+arr[i] it becomes 1 then arr[1] does not exist but u are still checking arr[1]+1 assume garbage there was 0 so its stuck in infinite loop

Why wrong?
It’s not necessary to include every explorer in one of the groups,so u can skip big ones
So start with smallest experience explorer.

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.