Apple Interview Question

find cycle in a given array