Cody

Solution 472014

Submitted on 14 Jul 2014 by Moe_2015
  • Size: 89
  • This is the leading solution.
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 = ''; y_correct = [2:28,1]; assert(isequal(solitaireKey(x),y_correct))

2   Pass
%% x = 'SECRET KEY'; y_correct = [26 25 7 8 2 13 6 16 27 4 5 19 23 21 14 15 9 3 20 11 12 28 17 18 10 1 24 22]; assert(isequal(solitaireKey(x),y_correct))

3   Pass
%% x = 'I don''t know the key to success, but the key to failure is trying to please everybody.'; y_correct = [16 10 28 4 26 25 8 27 19 24 7 1 9 21 22 23 17 11 14 15 12 13 20 5 2 3 18 6]; assert(isequal(solitaireKey(x),y_correct))

ans = Columns 1 through 16 16 10 28 4 26 25 8 27 19 24 7 1 9 21 22 23 Columns 17 through 28 17 11 14 15 12 13 20 5 2 3 18 6

Suggested Problems

More from this Author11