Cody

Solution 1354511

Submitted on 22 Nov 2017 by Peng Liu
  • Size: 23
  • 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
encoded_message = [100,26,104,47;67,103,32,107;105,93,104,78]; Decoder_Ring = [1,3;3,1]; y_correct = 'hi'; assert(isequal(Decode(Decoder_Ring,encoded_message),y_correct))

2   Pass
encoded_message = [100,26,114,47,83;67,117,103,32,107;105,93,104,78,22;112,110,111,94,101;96,82,43,115,113;22,105,44,112,94]; Decoder_Ring = [1,2,1,4,1,6,5,4;5,2,3,1,3,2,4,5]; y_correct = 'Surprise'; assert(isequal(Decode(Decoder_Ring,encoded_message),y_correct))

3   Pass
encoded_message = [33,84,100,103,107,10,22,44,67,92; 102,95,91,36,64,48,47,57,90,100; 84,112,150,32,50,68,72,99,115,30; 98,109,108,50,100,111,116,31,48,49; 21,41,81,85,105,108,18,17,133,132; 1,12,105,110,103,102,49,32,30,100; 111,101,98,97,103,104,88,77,71,91; 114,111,117,100,105,94,48,119,33,49; 109,108,42,27,76,110,90,55,120,113; 123,124,13,39,94,43,99,87,19,10]; Decoder_Ring = [1,7,8,3,3,9,7,3,3,7,1,7,6,8,5,4,9,3,3,7,9,6,6,4,7,3,4,8,8,3,4,6,8,6,6,4,8,3,3,7,10,8,9,8,3; 2,6,5,9,4,1,2,9,9,4,4,2,8,8,5,3,2,4,9,2,2,6,8,5,2,9,7,1,3,8,7,8,5,4,8,10,7,4,9,2,7,2,6,4,9]; y_correct = 'This message will self destruct in 10 seconds'; assert(isequal(Decode(Decoder_Ring,encoded_message),y_correct))

4   Pass
encoded_message = reshape([50:149],10,[]); Decoder_Ring = [6,7,5,8,6,4,5,7;7,7,7,5,6,6,6,7]; y_correct = 'straight'; assert(isequal(Decode(Decoder_Ring,encoded_message),y_correct))