Cody

# Problem 78. Implement a ROT13 cipher

Solution 2614828

Submitted on 26 Jun 2020 by 春樹 内糸
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 = 'I love MATLAB'; s2_correct = 'V ybir ZNGYNO'; assert(isequal(rot13(s1),s2_correct))

s2 = 'I love MATLAB' iu = 1×13 logical array 1 0 0 0 0 0 0 1 1 1 1 1 1 il = 1×13 logical array 0 0 1 1 1 1 0 0 0 0 0 0 0 s2 = 'V love MATLAB' s2 = 'V yove MATLAB' s2 = 'V y|ve MATLAB' s2 = 'V ybve MATLAB' s2 = 'V ybe MATLAB' s2 = 'V ybie MATLAB' s2 = 'V ybir MATLAB' s2 = 'V ybir ZATLAB' s2 = 'V ybir ZNTLAB' s2 = 'V ybir ZNaLAB' s2 = 'V ybir ZNGLAB' s2 = 'V ybir ZNGYAB' s2 = 'V ybir ZNGYNB' s2 = 'V ybir ZNGYNO'

2   Pass
s1 = 'I <3 MATLAB!!'; s2_correct = 'V <3 ZNGYNO!!'; assert(isequal(rot13(s1),s2_correct))

s2 = 'I <3 MATLAB!!' iu = 1×13 logical array 1 0 0 0 0 1 1 1 1 1 1 0 0 il = 1×13 logical array 0 0 0 0 0 0 0 0 0 0 0 0 0 s2 = 'V <3 MATLAB!!' s2 = 'V <3 ZATLAB!!' s2 = 'V <3 ZNTLAB!!' s2 = 'V <3 ZNaLAB!!' s2 = 'V <3 ZNGLAB!!' s2 = 'V <3 ZNGYAB!!' s2 = 'V <3 ZNGYNB!!' s2 = 'V <3 ZNGYNO!!'

3   Pass
s1 = 'The quick fox stumbled over the confusing instructions.'; s2_correct = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbaf.'; assert(isequal(rot13(s1),s2_correct))

s2 = 'The quick fox stumbled over the confusing instructions.' iu = 1×55 logical array Columns 1 through 45 1 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 0 0 Columns 46 through 55 0 0 0 0 0 0 0 0 0 0 il = 1×55 logical array Columns 1 through 45 0 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 Columns 46 through 55 1 1 1 1 1 1 1 1 1 0 s2 = 'ahe quick fox stumbled over the confusing instructions.' s2 = 'Ghe quick fox stumbled over the confusing instructions.' s2 = 'Gue quick fox stumbled over the confusing instructions.' s2 = 'Gur quick fox stumbled over the confusing instructions.' s2 = 'Gur ~uick fox stumbled over the confusing instructions.' s2 = 'Gur duick fox stumbled over the confusing instructions.' s2 = 'Gur dick fox stumbled over the confusing instructions.' s2 = 'Gur dhick fox stumbled over the confusing instructions.' s2 = 'Gur dhvck fox stumbled over the confusing instructions.' s2 = 'Gur dhvpk fox stumbled over the confusing instructions.' s2 = 'Gur dhvpx fox stumbled over the confusing instructions.' s2 = 'Gur dhvpx sox stumbled over the confusing instructions.' s2 = 'Gur dhvpx s|x stumbled over the confusing instructions.' s2 = 'Gur dhvpx sbx stumbled over the confusing instructions.' s2 = 'Gur dhvpx sb stumbled over the confusing instructions.' s2 = 'Gur dhvpx sbk stumbled over the confusing instructions.' s2 = 'Gur dhvpx sbk tumbled over the confusing instructions.' s2 = 'Gur dhvpx sbk ftumbled over the confusing instructions.' s2 = 'Gur dhvpx sbk fumbled over the confusing instructions.' s2 = 'Gur dhvpx sbk fgumbled over the confusing instructions.' s2 = 'Gur dhvpx sbk fgmbled over the confusing instructions.' s2 = 'Gur dhvpx sbk fghmbled over the confusing instructions.' s2 = 'Gur dhvpx sbk fghzbled over the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoled over the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyed over the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrd over the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq over the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq |ver the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bver the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq ber the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bier the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq birr the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bir the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire the confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire he confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire ghe confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gue confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur confusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur ponfusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur p|nfusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbnfusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pb{fusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbafusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbasusing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbassing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashsing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfing instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvng instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfv{g instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvag instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat instructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vnstructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat v{structions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vastructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vatructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vaftructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgructions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafguctions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgeuctions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgections.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehctions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehptions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgions.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvons.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgv|ns.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbns.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvb{s.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbas.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvba.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbaf.'

4   Pass
s1 = 'Snape kills Dumbledore on page 606. Also, there is no Santa.'; s2_correct = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnagn.'; assert(isequal(rot13(s1),s2_correct))

s2 = 'Snape kills Dumbledore on page 606. Also, there is no Santa.' iu = 1×60 logical array Columns 1 through 45 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 Columns 46 through 60 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 il = 1×60 logical array Columns 1 through 45 0 1 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 1 1 1 Columns 46 through 60 1 1 0 1 1 0 1 1 0 0 1 1 1 1 0 s2 = '`nape kills Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fnape kills Dumbledore on page 606. Also, there is no Santa.' s2 = 'F{ape kills Dumbledore on page 606. Also, there is no Santa.' s2 = 'Faape kills Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fanpe kills Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fan}e kills Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fance kills Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr kills Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xills Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvlls Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyls Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyys Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyy Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Dumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qumbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qmbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhmbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzbledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoledore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyedore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrdore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqore on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrq|re on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqbre on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqbe on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqbee on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber on page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber |n page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber bn page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber b{ page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba page 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba }age 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cage 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cnge 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cnte 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Also, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nlso, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyso, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyo, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfo, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyf|, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, there is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, here is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, ghere is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, guere is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurre is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gure is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, guree is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer is no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vs no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer v no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf no Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf {o Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ao Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf a| Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Santa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab `anta.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fanta.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnnta.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fn{ta.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnata.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnaa.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnaga.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnagn.'

### Community Treasure Hunt

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

Start Hunting!