Cody

# Problem 42525. Vigenere cipher - be like Sherlock Holmes!

Solution 1495631

Submitted on 17 Apr 2018 by David Verrelli
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
a='CTMCCDCTWCWG'; b='CAT'; y_correct = 'ATTACKATDAWN'; assert(isequal(decrypt(a,b),y_correct));

L = 12 kVec = 'CATCATCATCAT' text = 'ATTACKATDAWN'

2   Pass
a='ctmccdctwcwg'; b='cat'; y_correct='ATTACKATDAWN'; assert(isequal(decrypt(a,b),y_correct));

L = 12 kVec = 'CATCATCATCAT' text = 'ATTACKATDAWN'

3   Pass
a='uaflgsqamnoeqr'; b='matlab'; y_correct='IAMAGREATCODER'; assert(isequal(decrypt(a,b),y_correct));

L = 14 kVec = 'MATLABMATLABMA' text = 'IAMAGREATCODER'

4   Pass
ind = randi(3); switch ind case 1 a='sdirmclkvtldnyimhstdoecfnfsdirmclkvtldnyimhstdoecfnfsdirmclkvtldnyimhstdoecfnfsdirmclkvtldnyimhstdoecfnf'; b='cheater'; y_correct = 'QWERTYUIOPLKJHGFDSAZXCVBNMOMGKICSGEREZNFEVFLPDVALDGBSKEAKVHKCPUBGUITDBRWKEJBWDLZIYILJDRTSZWWBIHZPMMXYFUB'; assert(isequal(decrypt(a,b),y_correct)); case 2 a='mbvoegshbukmynhaqsetnhvykz' b='matlab' y_correct='ABCDEFGHIJKLMNOPQRSTUWVXYZ' assert(isequal(decrypt(a,b),y_correct)); case 3 a='az' b='za' y_correct='BZ' assert(isequal(decrypt(a,b),y_correct)); end

L = 104 kVec = 'CHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATERCHEATE' text = 'QWERTYUIOPLKJHGFDSAZXCVBNMOMGKICSGEREZNFEVFLPDVALDGBSKEAKVHKCPUBGUITDBRWKEJBWDLZIYILJDRTSZWWBIHZPMMXYFUB'

5   Pass