```
int V = nums.size();
vector<bool> visited(V,false);
if(nums.size() <= 1) return true;
visited[0] = true;
for(int i = 0;i < nums.size() && visited[i];i++){
int k = 1;
while(k <= nums[i] && k+i < nums.size()){
visited[k+i] = true;
k++;
}
if(visited[V-1] == true) return true;
}
//visited.clear();
return false;
```

even I tried to run TLE testcase as custom testcase which giving me TLE on leetcode while submitting ,but it gives me correct result as custom test case.