Apple interview question

find cycle in a given array