Cody

Problem 43969. Sleeping Queens 1

Solution 2466029

Submitted on 3 Jun 2020 by Karl Ezra Pilario
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   Pass
x = [1 5 3 2 4];y_correct = 9; assert(isequal(Sleeping(x),y_correct))

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

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

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

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

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

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!