Solve the problem to detect if an array, whose element is index of its next element, is circular, O(n^2) solution.