Cody

# Problem 565. Transposition as a CIPHER

Solution 1155953

Submitted on 7 Apr 2017 by Noriko Hounoki
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
s1 = 'My name is Sourav Mondal'; y_correct = 'MUYRNAAVMMEOINSDSAOL'; assert(isequal(transposition(s1),y_correct))

snum = 20 h = 10 aC = 77 89 78 65 77 69 73 83 83 79 85 82 65 86 77 79 78 68 65 76 aC1 = 77 89 78 65 77 69 73 83 83 79 aC2 = 85 82 65 86 77 79 78 68 65 76 newaC = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 0 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 0 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 0 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 0 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 73 0 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 73 78 0 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 73 78 83 0 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 73 78 83 68 0 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 73 78 83 68 83 0 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 73 78 83 68 83 65 0 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 73 78 83 68 83 65 79 0 newaC = 77 85 89 82 78 65 65 86 77 77 69 79 73 78 83 68 83 65 79 76 y = 'MUYRNAAVMMEOINSDSAOL'

2   Pass
s1 = 'i am a common cipher'; y_correct = 'IOANMCAICPOHMEMR'; assert(isequal(transposition(s1),y_correct))

snum = 16 h = 8 aC = 73 65 77 65 67 79 77 77 79 78 67 73 80 72 69 82 aC1 = 73 65 77 65 67 79 77 77 aC2 = 79 78 67 73 80 72 69 82 newaC = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 73 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 73 79 0 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 73 79 65 0 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 73 79 65 78 0 0 0 0 0 0 0 0 0 0 0 0 newaC = 73 79 65 78 77 0 0 0 0 0 0 0 0 0 0 0 newaC = 73 79 65 78 77 67 0 0 0 0 0 0 0 0 0 0 newaC = 73 79 65 78 77 67 65 0 0 0 0 0 0 0 0 0 newaC = 73 79 65 78 77 67 65 73 0 0 0 0 0 0 0 0 newaC = 73 79 65 78 77 67 65 73 67 0 0 0 0 0 0 0 newaC = 73 79 65 78 77 67 65 73 67 80 0 0 0 0 0 0 newaC = 73 79 65 78 77 67 65 73 67 80 79 0 0 0 0 0 newaC = 73 79 65 78 77 67 65 73 67 80 79 72 0 0 0 0 newaC = 73 79 65 78 77 67 65 73 67 80 79 72 77 0 0 0 newaC = 73 79 65 78 77 67 65 73 67 80 79 72 77 69 0 0 newaC = 73 79 65 78 77 67 65 73 67 80 79 72 77 69 77 0 newaC = 73 79 65 78 77 67 65 73 67 80 79 72 77 69 77 82 y = 'IOANMCAICPOHMEMR'

3   Pass
s1 = 'BATMAN rules GOTHAM'; y_correct = 'BEASTGMOATNHRAUML'; assert(isequal(transposition(s1),y_correct))

snum = 17 h = 8.5000 aC = 66 65 84 77 65 78 82 85 76 69 83 71 79 84 72 65 77 [Warning: Integer operands are required for colon operator when used as index] aC1 = 66 65 84 77 65 78 82 85 [Warning: Integer operands are required for colon operator when used as index] aC2 = 69 83 71 79 84 72 65 77 newaC = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 icenter = 9 newaC = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 76 newaC = 66 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 76 newaC = 66 69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 76 newaC = 66 69 65 0 0 0 0 0 0 0 0 0 0 0 0 0 76 newaC = 66 69 65 83 0 0 0 0 0 0 0 0 0 0 0 0 76 newaC = 66 69 65 83 84 0 0 0 0 0 0 0 0 0 0 0 76 newaC = 66 69 65 83 84 71 0 0 0 0 0 0 0 0 0 0 76 newaC = 66 69 65 83 84 71 77 0 0 0 0 0 0 0 0 0 76 newaC = 66 69 65 83 84 71 77 79 0 0 0 0 0 0 0 0 76 newaC = 66 69 65 83 84 71 77 79 65 0 0 0 0 0 0 0 76 newaC = 66 69 65 83 84 71 77 79 65 84 0 0 0 0 0 0 76 newaC = 66 69 65 83 84 71 77 79 65 84 78 0 0 0 0 0 76 newaC = 66 69 65 83 84 71 77 79 65 84 78 72 0 0 0 0 76 newaC = 66 69 65 83 84 71 77 79 65 84 78 72 82 0 0 0 76 newaC = 66 69 65 83 84 71 77 79 65 84 78 72 82 65 0 0 76 newaC = 66 69 65 83 84 71 77 79 65 84 78 72 82 65 85 0 76 newaC = 66 69 65 83 84 71 77 79 65 84 78 72 82 65 85 77 76 y = 'BEASTGMOATNHRAUML'

### Community Treasure Hunt

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

Start Hunting!