Bloomberg interview question

Find cycle in an array