Cody

# Problem 2476. Max Change in Consecutive Elements

Solution 1998695

Submitted on 1 Nov 2019
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   Fail
x = [1 10 3 0 2 4 0 -8 9 1]; y_correct = [8 9]; assert(isequal(maxChange(x),y_correct))

a = 9 -7 -3 2 2 -4 -8 17 -8 y = 1×0 empty double row vector

Assertion failed.

2   Fail
x = [10 15 2 18 40]; y_correct = [4 5]; assert(isequal(maxChange(x),y_correct))

a = 5 -13 16 22 y = 1×0 empty double row vector

Assertion failed.

3   Fail
x = 1:10; x(4) = 0; y_correct = [4 5]; assert(isequal(maxChange(x),y_correct))

a = 1 1 -3 5 1 1 1 1 1 y = 5 6

Assertion failed.

4   Fail
x = [1 10 100 1e3 1e4 1e5 1e6 1e7]; y_correct = [7 8]; assert(isequal(maxChange(x),y_correct))

a = 9 90 900 9000 90000 900000 9000000 y = 1×0 empty double row vector

Assertion failed.

5   Fail
x = [-10 10 -8 7 -5 3 -2 1 -1 0]; y_correct = [1 2]; assert(isequal(maxChange(x),y_correct))

a = 20 -18 15 -12 8 -5 3 -2 1 y = 1×0 empty double row vector

Assertion failed.

6   Fail
x = ones(1,1e6); x(789) = 0; x(788) = 0.5; y_correct = [789 790]; assert(isequal(maxChange(x),y_correct))

a = Columns 1 through 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 19 through 36 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 37 through 54 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 55 through 72 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 73 through 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 91 through 108 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 109 through 126 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 127 through 144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 145 through 162 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 163 through 180 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 181 through 198 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 199 through 216 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 217 through 234 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 235 through 252 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 253 through 270 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 271 through 288 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 289 through 306 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 307 through 324 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 325 through 342 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 343 through 360 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 361 through 378 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 379 through 396 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 397 through 414 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 415 through 432 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 433 through 450 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 451 through 468 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 469 through 486 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 487 through 504 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 505 through 522 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 523 through 540 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 541 through 558 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 559 through 576 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 577 through 594 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 595 through 612 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 613 through 630 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 631 through 648 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 649 through 666 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 667 through 684 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 685 through 702 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 703 through 720 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 721 through 738 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 739 through 756 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 757 through 774 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 775 through 792 0 0 0 0 0 0 0 0 0 0 0 0 -0.5000 -0.5000 1.0000 0 0 0 Columns 793 through 810 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 811 through 828 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 829 through 846 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 847 through 864 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

Assertion failed.