how can [3,1,2] be true and [2,1] be false ?


@mpmg not sure if i follow this
if the first value at index 0 is 3, then the new index will be 0+3 = 3 which will come back to 0. hence it will be 0>0>0 hence circular loop that has only one element. can you please explain why this is the valid loop?

@vadimsf The question is if there exists any loop, not whether starting from the first element puts you on a loop.
The 0>0 loop doesn't matter, but the 1>2>1 loop is valid.