Cody

Solution 1557501

Submitted on 12 Jun 2018 by Ryan Mitchell
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' words = 1×1 cell array {'hello'} alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' oldletterIndx = 1 2 3 4 5 letterIndx = 1 4 3 2 5 words = 1×1 cell array {'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.' words = 9×1 cell array {'This' } {'is' } {'the' } {'first' } {'time' } {'I' } {'have' } {'used' } {'MATLAB.'} alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' oldletterIndx = 1 2 3 4 letterIndx = 1 3 2 4 words = 9×1 cell array {'Tihs' } {'is' } {'the' } {'first' } {'time' } {'I' } {'have' } {'used' } {'MATLAB.'} oldletterIndx = 1 2 letterIndx = 1 2 words = 9×1 cell array {'Tihs' } {'is' } {'the' } {'first' } {'time' } {'I' } {'have' } {'used' } {'MATLAB.'} oldletterIndx = 1 2 3 letterIndx = 1 2 3 words = 9×1 cell array {'Tihs' } {'is' } {'the' } {'first' } {'time' } {'I' } {'have' } {'used' } {'MATLAB.'} oldletterIndx = 1 2 3 4 5 letterIndx = 1 4 3 2 5 words = 9×1 cell array {'Tihs' } {'is' } {'the' } {'fsrit' } {'time' } {'I' } {'have' } {'used' } {'MATLAB.'} oldletterIndx = 1 2 3 4 letterIndx = 1 3 2 4 words = 9×1 cell array {'Tihs' } {'is' } {'the' } {'fsrit' } {'tmie' } {'I' } {'have' } {'used' } {'MATLAB.'} oldletterIndx = 1 oldletterIndx = 1 2 3 4 letterIndx = 1 3 2 4 words = 9×1 cell array {'Tihs' } {'is' } {'the' } {'fsrit' } {'tmie' } {'I' } {'hvae' } {'used' } {'MATLAB.'} oldletterIndx = 1 2 3 4 letterIndx = 1 3 2 4 words = 9×1 cell array {'Tihs' } {'is' } {'the' } {'fsrit' } {'tmie' } {'I' } {'hvae' } {'uesd' } {'MATLAB.'} oldletterIndx = 1 2 3 4 5 6 letterIndx = 1 5 4 3 2 6 words = 9×1 cell array {'Tihs' } {'is' } {'the' } {'fsrit' } {'tmie' } {'I' } {'hvae' } {'uesd' } {'MALTAB.'} sOut = 'Tihs is the fsrit tmie I hvae uesd MALTAB.'