Cody

# Problem 1512. Clock Solitaire

Solution 1952287

Submitted on 28 Sep 2019 by Augusto Mazzei
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
deck = [1:52]; assert(isequal(clockSolitaire(deck),false))

k = 10 k = 11 k = 2 k = 5 k = 4 k = 13 k = 11 k = 3 k = 9 k = 7 k = 12 k = 6 k = 8 k = 3 k = 10 k = 12 k = 7 k = 13 k = 12 k = 8 k = 4 k = 1 k = 1 k = 2 k = 6 k = 9 k = 8 k = 5 k = 5 k = 6 k = 10 k = 13 k = 13 ans = logical 0

2   Pass
deck = [8 1 5 2 30 23 46 21 3 51 6 27 42 48 37 33 12 25 45 36 31 34 29 35 15 17 43 13 39 40 18 50 26 9 4 28 38 16 11 22 49 24 14 7 32 20 47 44 19 10 41 52]; assert(isequal(clockSolitaire(deck),true))

k = 6 k = 5 k = 12 k = 6 k = 8 k = 13 k = 10 k = 12 k = 7 k = 2 k = 4 k = 3 k = 3 k = 12 k = 8 k = 1 k = 8 k = 5 k = 12 k = 5 k = 6 k = 3 k = 6 k = 9 k = 13 k = 2 k = 10 k = 3 k = 1 k = 1 k = 5 k = 10 k = 11 k = 10 k = 9 k = 9 k = 4 k = 9 k = 2 k = 7 k = 4 k = 11 k = 11 k = 1 k = 2 k = 8 k = 11 k = 7 k = 4 k = 7 k = 13 k = 13 ans = logical 1

3   Pass
deck = [52:-1:1]; assert(isequal(clockSolitaire(deck),false))

k = 4 k = 1 k = 13 k = 3 k = 5 k = 10 k = 3 k = 4 k = 13 k = 2 k = 9 k = 7 k = 2 k = 8 k = 11 k = 12 k = 8 k = 10 k = 2 k = 7 k = 1 k = 12 k = 7 k = 13 k = 1 ans = logical 0

4   Pass
deck = [40 29 25 37 23 41 13 50 33 2 42 20 49 48 27 46 36 45 28 1 7 11 14 5 9 26 15 21 12 8 19 35 10 38 34 52 32 51 31 16 18 22 6 3 47 44 43 4 24 17 30 39]; assert(isequal(clockSolitaire(deck),true))

k = 11 k = 5 k = 10 k = 6 k = 7 k = 9 k = 10 k = 12 k = 8 k = 12 k = 5 k = 6 k = 11 k = 9 k = 12 k = 4 k = 10 k = 5 k = 2 k = 10 k = 3 k = 7 k = 13 k = 4 k = 9 k = 8 k = 8 k = 6 k = 1 k = 1 k = 3 k = 2 k = 2 k = 13 k = 4 k = 1 k = 12 k = 4 k = 7 k = 2 k = 11 k = 6 k = 5 k = 1 k = 11 k = 3 k = 3 k = 7 k = 8 k = 9 k = 13 k = 13 ans = logical 1

5   Pass
deck = [40 29 25 37 23 41 13 50 33 2 42 20 52 48 27 46 36 45 28 1 7 11 14 5 9 26 15 21 12 8 19 35 10 38 34 49 32 51 31 16 18 22 6 3 47 44 43 4 24 17 30 39]; assert(isequal(clockSolitaire(deck),false))

k = 11 k = 5 k = 10 k = 6 k = 7 k = 9 k = 10 k = 12 k = 8 k = 12 k = 5 k = 6 k = 11 k = 9 k = 12 k = 4 k = 13 k = 4 k = 9 k = 8 k = 8 k = 6 k = 1 k = 1 k = 3 k = 7 k = 13 k = 4 k = 1 k = 12 k = 4 k = 7 k = 2 k = 10 k = 5 k = 2 k = 2 k = 13 k = 13 ans = logical 0

6   Pass
deck = [8 1 5 2 30 23 46 21 3 51 6 27 13 48 37 33 12 25 45 36 31 34 29 35 15 17 43 42 39 40 18 50 26 9 4 28 38 16 11 22 49 24 14 7 32 20 47 44 19 10 41 52]; assert(isequal(clockSolitaire(deck),false))

k = 6 k = 5 k = 12 k = 6 k = 8 k = 13 k = 10 k = 12 k = 7 k = 2 k = 4 k = 13 k = 2 k = 10 k = 3 k = 3 k = 12 k = 8 k = 1 k = 8 k = 5 k = 12 k = 5 k = 6 k = 3 k = 6 k = 9 k = 13 k = 13 ans = logical 0