Cody

# Problem 1277. How many days does the cat take to climb out of the hole?

Solution 2164101

Submitted on 18 Mar 2020 by Nikolaos Nikolaou
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
h = 20; m=5; n=3; y_correct = 9; assert(isequal(catdays(h,m,n),y_correct))

s = 0 s = 5 s = 2 s = 7 s = 4 s = 9 s = 6 s = 11 s = 8 s = 13 s = 10 s = 15 s = 12 s = 17 s = 14 s = 19 s = 16 s = 21 y = 9

2   Pass
h = 15; m=6; n=1; y_correct = 3; assert(isequal(catdays(h,m,n),y_correct))

s = 0 s = 6 s = 5 s = 11 s = 10 s = 16 y = 3

3   Pass
h = 25; m=6; n=5; y_correct = 21; assert(isequal(catdays(h,m,n),y_correct))

s = 0 s = 6 s = 1 s = 7 s = 2 s = 8 s = 3 s = 9 s = 4 s = 10 s = 5 s = 11 s = 6 s = 12 s = 7 s = 13 s = 8 s = 14 s = 9 s = 15 s = 10 s = 16 s = 11 s = 17 s = 12 s = 18 s = 13 s = 19 s = 14 s = 20 s = 15 s = 21 s = 16 s = 22 s = 17 s = 23 s = 18 s = 24 s = 19 s = 25 s = 20 s = 26 y = 21

4   Pass
h = 22; m=6; n=5; y_correct = 18; assert(isequal(catdays(h,m,n),y_correct))

s = 0 s = 6 s = 1 s = 7 s = 2 s = 8 s = 3 s = 9 s = 4 s = 10 s = 5 s = 11 s = 6 s = 12 s = 7 s = 13 s = 8 s = 14 s = 9 s = 15 s = 10 s = 16 s = 11 s = 17 s = 12 s = 18 s = 13 s = 19 s = 14 s = 20 s = 15 s = 21 s = 16 s = 22 s = 17 s = 23 y = 18

5   Pass
h = 31; m=8; n=5; y_correct = 9; assert(isequal(catdays(h,m,n),y_correct))

s = 0 s = 8 s = 3 s = 11 s = 6 s = 14 s = 9 s = 17 s = 12 s = 20 s = 15 s = 23 s = 18 s = 26 s = 21 s = 29 s = 24 s = 32 y = 9

### Community Treasure Hunt

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

Start Hunting!