package leetcode;

/**
 * https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/
 */
public class Problem1752 {
    public boolean check(int[] nums) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem1752 prob = new Problem1752();
        System.out.println(prob.check(new int[]{3,4,5,1,2})); // true
        System.out.println(prob.check(new int[]{2,1,3,4})); // false
        System.out.println(prob.check(new int[]{1,2,3})); // true
        System.out.println(prob.check(new int[]{1,1,1})); // true
        System.out.println(prob.check(new int[]{2,1})); // true
    }
}

@@ -169,35 +169,636 @@
     
-// TODO%0A        return fals
+int min = 0;%0A        int index = 0;%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A            if (i == 0) %7B%0A                min = nums%5Bi%5D;%0A            %7D else %7B%0A                if (nums%5Bi%5D %3C min) %7B%0A                    index = i;%0A                    min = nums%5Bi%5D;%0A                %7D%0A            %7D%0A        %7D%0A        int current = index;%0A        int next = (index + 1) %25 nums.length;%0A        while (next != index) %7B%0A            if (nums%5Bcurrent%5D %3E nums%5Bnext%5D) %7B%0A                return false;%0A            %7D%0A            current = (current + 1) %25 nums.length;%0A            next = (next + 1) %25 nums.length;%0A        %7D%0A        return tru
 e;%0A 
@@ -894,16 +894,18 @@
 1752();%0A
+//
         
@@ -958,32 +958,34 @@
 1,2%7D)); // true%0A
+//
         System.o
@@ -1037,16 +1037,18 @@
 / false%0A
+//
         
@@ -1097,32 +1097,34 @@
 2,3%7D)); // true%0A
+//
         System.o
@@ -1169,24 +1169,26 @@
 )); // true%0A
+//
         Syst
@@ -1239,16 +1239,83 @@
 // true%0A
+        System.out.println(prob.check(new int%5B%5D%7B6,10,6%7D)); // true%0A
     %7D%0A%7D%0A

Update problem 1752