Given an integer array of size N where elements are >= 0, start from arr[startIndex] and follow each element to the index it points to until a cycle is found. Return the length of the cycle, or -1 if…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.