Cody

Solution 1943046

Submitted on 19 Sep 2019 at 16:51 by Augusto Mazzei
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = [4 5 6 7 0 1 2]; y_correct = true; assert(isequal(isRotaSorTED(x),y_correct))

x = 4 5 6 7 0 1 2 2 4 5 6 7 0 1 1 2 4 5 6 7 0 0 1 2 4 5 6 7 7 0 1 2 4 5 6 6 7 0 1 2 4 5 5 6 7 0 1 2 4 ans = logical 1

2   Pass
x = [2 5 6 8 0 1 3]; y_correct = false; assert(isequal(isRotaSorTED(x),y_correct))

x = 2 5 6 8 0 1 3 3 2 5 6 8 0 1 1 3 2 5 6 8 0 0 1 3 2 5 6 8 8 0 1 3 2 5 6 6 8 0 1 3 2 5 5 6 8 0 1 3 2 ans = logical 0

3   Pass
x = [101, 103, 106, 109, 158, 164, 182, 187, 202, 205, 2, 3, 32, 57, 69, 74, 81, 99, 100]; y_correct = true; assert(isequal(isRotaSorTED(x),y_correct))

x = 101 103 106 109 158 164 182 187 202 205 2 3 32 57 69 74 81 99 100 100 101 103 106 109 158 164 182 187 202 205 2 3 32 57 69 74 81 99 99 100 101 103 106 109 158 164 182 187 202 205 2 3 32 57 69 74 81 81 99 100 101 103 106 109 158 164 182 187 202 205 2 3 32 57 69 74 74 81 99 100 101 103 106 109 158 164 182 187 202 205 2 3 32 57 69 69 74 81 99 100 101 103 106 109 158 164 182 187 202 205 2 3 32 57 57 69 74 81 99 100 101 103 106 109 158 164 182 187 202 205 2 3 32 32 57 69 74 81 99 100 101 103 106 109 158 164 182 187 202 205 2 3 3 32 57 69 74 81 99 100 101 103 106 109 158 164 182 187 202 205 2 2 3 32 57 69 74 81 99 100 101 103 106 109 158 164 182 187 202 205 205 2 3 32 57 69 74 81 99 100 101 103 106 109 158 164 182 187 202 202 205 2 3 32 57 69 74 81 99 100 101 103 106 109 158 164 182 187 187 202 205 2 3 32 57 69 74 81 99 100 101 103 106 109 158 164 182 182 187 202 205 2 3 32 57 69 74 81 99 100 101 103 106 109 158 164 164 182 187 202 205 2 3 32 57 69 74 81 99 100 101 103 106 109 158 158 164 182 187 202 205 2 3 32 57 69 74 81 99 100 101 103 106 109 109 158 164 182 187 202 205 2 3 32 57 69 74 81 99 100 101 103 106 106 109 158 164 182 187 202 205 2 3 32 57 69 74 81 99 100 101 103 103 106 109 158 164 182 187 202 205 2 3 32 57 69 74 81 99 100 101 ans = logical 1

4   Pass
x = [42 1:10]; y_correct = true; assert(isequal(isRotaSorTED(x),y_correct))

x = 42 1 2 3 4 5 6 7 8 9 10 10 42 1 2 3 4 5 6 7 8 9 9 10 42 1 2 3 4 5 6 7 8 8 9 10 42 1 2 3 4 5 6 7 7 8 9 10 42 1 2 3 4 5 6 6 7 8 9 10 42 1 2 3 4 5 5 6 7 8 9 10 42 1 2 3 4 4 5 6 7 8 9 10 42 1 2 3 3 4 5 6 7 8 9 10 42 1 2 2 3 4 5 6 7 8 9 10 42 1 1 2 3 4 5 6 7 8 9 10 42 ans = logical 1

5   Pass
x = 1:10; x(1) = 100; x(4) = 1; y_correct = false; assert(isequal(isRotaSorTED(x),y_correct))

x = 100 2 3 1 5 6 7 8 9 10 10 100 2 3 1 5 6 7 8 9 9 10 100 2 3 1 5 6 7 8 8 9 10 100 2 3 1 5 6 7 7 8 9 10 100 2 3 1 5 6 6 7 8 9 10 100 2 3 1 5 5 6 7 8 9 10 100 2 3 1 1 5 6 7 8 9 10 100 2 3 3 1 5 6 7 8 9 10 100 2 2 3 1 5 6 7 8 9 10 100 ans = logical 0

6   Pass
x = 10:-1:1; y_correct = false; assert(isequal(isRotaSorTED(x),y_correct))

x = 10 9 8 7 6 5 4 3 2 1 1 10 9 8 7 6 5 4 3 2 2 1 10 9 8 7 6 5 4 3 3 2 1 10 9 8 7 6 5 4 4 3 2 1 10 9 8 7 6 5 5 4 3 2 1 10 9 8 7 6 6 5 4 3 2 1 10 9 8 7 7 6 5 4 3 2 1 10 9 8 8 7 6 5 4 3 2 1 10 9 9 8 7 6 5 4 3 2 1 10 ans = logical 0