Cody

# Problem 2476. Max Change in Consecutive Elements

Solution 1232677

Submitted on 17 Jul 2017 by Said BOUREZG
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 = [1 10 3 0 2 4 0 -8 9 1]; y_correct = [8 9]; assert(isequal(maxChange(x),y_correct))

n = 8 ans = 8 9

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

n = 4 ans = 4 5

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

n = 4 ans = 4 5

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

n = 7 ans = 7 8

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

n = 1 ans = 1 2

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

n = 789 ans = 789 790

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!