Beginner level solution used collections
\n# Code\n\nclass Solution {\n    public int minimumRightShifts(List<Integer> nums) {\n        ArrayList<Integer> sorted = new ArrayList<>(nums);\n        Colle
\n# Code\n```\nclass Solution {\n    public int minimumRightShifts(List<Integer> nums) {\n        ArrayList<Integer> sorted = new ArrayList<>(nums);\n        Collections.sort(sorted);\n        int count = 0;\n        for (int i = 0; i < nums.size(); i++) {\n            if(!nums.equals(sorted)){\n                Collections.rotate(nums, 1);\n                count++;\n            }\n        }\n\n        if(!nums.equals(sorted))\n            count = -1;\n\n        return count;\n    }\n}\n```
['Java']