Cody

Solution 2647205

Submitted on 3 Jul 2020 by Li Kehan Li
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
sIn = 'hello' sOut = 'hlleo' assert(isequal(scrambleText(sIn),sOut))

sIn = 'hello' sOut = 'hlleo' a = 1×1 cell array {'hello'} d = 1 c = '0 0 0 0 0' c = '00000' ans = 1 5 b = 'hlleo' c = 'hlleo' sOut = 'hlleo'

2   Pass
sIn = 'This is the first time I have used MATLAB.' sOut = 'Tihs is the fsrit tmie I hvae uesd MALTAB.' assert(isequal(scrambleText(sIn),sOut))

sIn = 'This is the first time I have used MATLAB.' sOut = 'Tihs is the fsrit tmie I hvae uesd MALTAB.' a = 1×9 cell array {'This'} {'is'} {'the'} {'first'} {'time'} {'I'} {'have'} {'used'} {'MATLAB.'} d = 1 c = '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0' c = '000000000000000000000000000000000000000000' ans = 1 42 b = 'Tihs' c = 'Tihs00000000000000000000000000000000000000' c = 'Tihs 0000000000000000000000000000000000000' d = 6 b = 'is' c = 'Tihs is00000000000000000000000000000000000' c = 'Tihs is 0000000000000000000000000000000000' d = 9 b = 'the' c = 'Tihs is the0000000000000000000000000000000' c = 'Tihs is the 000000000000000000000000000000' d = 13 b = 'fsrit' c = 'Tihs is the fsrit0000000000000000000000000' c = 'Tihs is the fsrit 000000000000000000000000' d = 19 b = 'tmie' c = 'Tihs is the fsrit tmie00000000000000000000' c = 'Tihs is the fsrit tmie 0000000000000000000' d = 24 b = 'I' c = 'Tihs is the fsrit tmie I000000000000000000' c = 'Tihs is the fsrit tmie I 00000000000000000' d = 26 b = 'hvae' c = 'Tihs is the fsrit tmie I hvae0000000000000' c = 'Tihs is the fsrit tmie I hvae 000000000000' d = 31 b = 'uesd' c = 'Tihs is the fsrit tmie I hvae uesd00000000' c = 'Tihs is the fsrit tmie I hvae uesd 0000000' d = 36 b = 'MALTAB.' c = 'Tihs is the fsrit tmie I hvae uesd MALTAB.' sOut = 'Tihs is the fsrit tmie I hvae uesd MALTAB.'

Suggested Problems

More from this Author95