C#
int N = A.ength;\n        int change[] = new int[N];\n        for (int i = 0; i < N; ++i) change[(i - A[i] + 1 + N) % N] -= 1;\n        int max_i = 0;\n        
```int N = A.ength;\n        int change[] = new int[N];\n        for (int i = 0; i < N; ++i) change[(i - A[i] + 1 + N) % N] -= 1;\n        int max_i = 0;\n        for (int i = 1; i < N; ++i) {\n            change[i] += change[i - 1] + 1;\n            max_i = change[i] > change[max_i] ? i : max_i;\n        }\n \xA0 \xA0 \xA0 \xA0return max_i;```
[]