Simple Easy Java Solution with Explanation - Check only Conditions
\n       class Solution {\n              public int minimumRightShifts(List nums) {\n                  int ind = 0, c = 0;\n                  for(int i = 1; i n
\n       class Solution {\n              public int minimumRightShifts(List<Integer> nums) {\n                  int ind = 0, c = 0;\n                  for(int i = 1; i<nums.size(); i++){\n                      if(nums.get(i - 1) > nums.get(i)){     // Check prev number is greater than curr \n                           ind = i;\n                           c++;        // And Count those Occurences\n                      }\n                }\n                if(c > 1){           // If greater than 1 then we cannot rotate the array into sorted form\n                   return -1;\n               }\n               if(ind == 0){   return 0;  }\n               return nums.get(nums.size() - 1) > nums.get(0) ? -1 : nums.size() - ind; \n               }\n           }
['Java']