Two SigmaSoftware Engineer · Take-home ProjectCodemia practiceCount cycle in array
Given an array of integers, write a function to count the number of distinct cycles present in the array. A cycle is defined as a sequence of indices where each index points to the next index in the cycle, and the last index points back to the first. The function should return the count of such cycles found in the array.
Medium
Coding & Algorithms