count the occurances where numbers are not in places O(N)
IntuitionSingle parsingApproachcount the occurances where numbers are not in placesComplexity

Time complexity: O(N)


Space complexity:O(1)

Code
# Intuition
Single parsing

# Approach
count the occurances where numbers are not in places

# Complexity
- Time complexity: O(N)

- Space complexity:O(1)

# Code
```c []
int minimumRightShifts(int* nums, int numsSize) {
    int result  = -1;
    int count = 0;
    int index;

    for(int i=0;i<numsSize;i++){
        if (nums[i]>nums[(i+1)%numsSize]) {
            count++;
            index = i;
        }

        if (count>1)
            return result;
    }
    return numsSize - index-1;
}
```
['C']