Cody

Solution 2100856

Submitted on 21 Jan 2020 by Asif Newaz
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))

a = 104 105 out = 'hi'

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))

a = 83 117 114 112 114 105 115 101 out = 'Surprise'

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))

a = Columns 1 through 30 84 104 105 115 32 109 101 115 115 97 103 101 32 119 105 108 108 32 115 101 108 102 32 100 101 115 116 114 117 99 Columns 31 through 45 116 32 105 110 32 49 48 32 115 101 99 111 110 100 115 out = 'This message will self destruct in 10 seconds'

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))

a = 115 116 114 97 105 103 104 116 out = 'straight'