Cody

# Problem 766. Implement Solitaire cipher for N long deck.

Solution 289107

Submitted on 25 Jul 2013 by Mehmet OZC
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 4 7 10 13 16 19 22 25 28 3 6 9 12 15 18 21 24 27 2 5 8 11 14 17 20 23 26]; m = 10; out = [8 26 1 4 7 23 8 8 4 24]; assert(isequal(solitaire(deck, m),out))

m = 10 m = 3 m = 5 m = 25 m = 10 m = 12 m = 21 m = 9 m = 8 m = 22

2   Pass
%% deck = 1:28; m = 10; out = [3 22 9 4 23 7 25 16 14 14]; assert(isequal(solitaire(deck, m),out))

m = 27 m = 26 m = 4 m = 25 m = 4 m = 22 m = 8 m = 1 m = 20 m = 10

3   Pass
%% deck = 1:28; m = 10; out = [3 22 9 4 23 7 25 16 14 14]; assert(isequal(solitaire(deck, m),out))

m = 27 m = 26 m = 4 m = 25 m = 4 m = 22 m = 8 m = 1 m = 20 m = 10

4   Pass
%% deck = 1:5; m = 10; out = [3 4 1 1 5 5 4 2 4 1]; assert(isequal(solitaire(deck, m),out))

m = 4 m = 3 m = 4 m = 4 m = 1 m = 4 m = 4 m = 2 m = 1 m = 4

### Community Treasure Hunt

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

Start Hunting!