class Solution {
public boolean check(int[] nums) {
int n = nums.length;
int x = 0;
for(int i = 0 ; i < n - 1 ; i ++ ){
if(nums[i] > nums[i + 1]) {
x = i + 1;
break;
}
}
if( x == 0) return true;
for(int i = x; i < n - 1; i++) {
if(nums[i] > nums[i + 1]) {
return false;
}
}
return nums[0] >= nums[n - 1];
}
}
标签:return,nums,int,轮转,排序,1752
From: https://www.cnblogs.com/eiffelzero/p/16929908.html