Easy to understand solution in Java. Beats 100 %.
ApproachWe loop through the list and compare each element with the next. If nums.get[i] > nums.get((i + 1) % n), we increment the dropCount and record the index
# Approach
We loop through the list and compare each element with the next. If nums.get[i] > nums.get((i + 1) % n), we increment the dropCount and record the index after the dropIndex.

If there is more than one drop, it's impossible to sort the array by right shifts, so we return -1.

If no drops are found, the array is already sorted, and we return 0.

If exactly one drop is found, the number of shifts required is the number of elements after the drop point (n - dropIndex), which will bring the smallest element to the front and sort the array.

# Complexity
- Time complexity:
O(n)

- Space complexity:
O(1)

# Code
```java []
class Solution {
    public int minimumRightShifts(List<Integer> nums) {
        int n = nums.size();
        int dropCount = 0;
        int dropIndex = -1;

        for (int i = 0; i < n; i++) {
            if (nums.get(i) > nums.get((i + 1) % n)) {
                dropCount++;
                dropIndex = i + 1;
            }
        }

        if (dropCount > 1) {
            return -1;
        }

        if (dropCount == 0) {
            return 0;
        }
        return n - dropIndex;
    }
}
```
['Array', 'Java']