Task: In a one-dimensional array, each element is an index on an element of the same array. Find and print the index of items that are "looped". Example: a[0] = 7; a[1] = 3; a[2] = 1; a[3] = 2; a[4] = 0 a[0] = 7; a[1] = 3; a[2] = 1; a[3] = 2; a[4] = 0
the elements a[1]->a[3]->a[2]->a[1] are looped.
Solution: I can not figure out where to start. If someone can give an example and / or explain, it will be great. I can not figure out the condition under which the presence of such "looped" numbers will be checked.