Cody

Problem 43969. Sleeping Queens 1

Solution 1336218

Submitted on 12 Nov 2017
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 = [5 6 7 8 9];y_correct = 5; assert(isequal(Sleeping(x),y_correct))

2   Fail
x = [1 5 3 2 4];y_correct = 9; assert(isequal(Sleeping(x),y_correct))

Assertion failed.

3   Fail
x = [2 4 8 4 2];y_correct = 12; assert(isequal(Sleeping(x),y_correct))

Assertion failed.

4   Fail
x = [1 1 1 2 1];y_correct = 17; assert(isequal(Sleeping(x),y_correct))

Assertion failed.

5   Fail
x = [3 6 5 1 8];y_correct = 7; assert(isequal(Sleeping(x),y_correct))

Assertion failed.

6   Fail
assert(isequal(Sleeping([1 6 1 7 8]),11))

Assertion failed.

7   Fail
assert(isequal(Sleeping([2 3 3 1 5]),10))

Assertion failed.

Suggested Problems

More from this Author80

Community Treasure Hunt

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

Start Hunting!