Cody

Solution 124581

Submitted on 7 Aug 2012 by Nigel Davies
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 ans = 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. tokens = Columns 1 through 6 'This ' 'is ' 'the ' 'first ' 'time ' 'I ' Columns 7 through 9 'have ' 'used ' 'MATLAB.' g = This h = g = This ans = Tihs g = is h = g = is ans = is g = the h = g = the ans = the g = first h = g = first ans = fsrit g = time h = g = time ans = tmie g = I h = g = I g = I g = have h = g = have ans = hvae g = used h = g = used ans = uesd g = MATLAB. h = . g = MATLAB ans = MALTAB ans = Tihs is the fsrit tmie I hvae uesd MALTAB.