Cody

# Problem 1201. Simple Decoder Ring

Solution 1902483

Submitted on 16 Aug 2019 by Nikolaos Nikolaou
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
inString1 = 'I am ready to try it - with punctuation and CAPS!'; outString1a = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xka ZXMP!'; assert(isequal(simpleDecoderRing(inString1,-3),outString1a ));

outString = 'F' outString = 'F ' outString = 'F x' outString = 'F xj' outString = 'F xj ' outString = 'F xj o' outString = 'F xj ob' outString = 'F xj obx' outString = 'F xj obxa' outString = 'F xj obxav' outString = 'F xj obxav ' outString = 'F xj obxav q' outString = 'F xj obxav ql' outString = 'F xj obxav ql ' outString = 'F xj obxav ql q' outString = 'F xj obxav ql qo' outString = 'F xj obxav ql qov' outString = 'F xj obxav ql qov ' outString = 'F xj obxav ql qov f' outString = 'F xj obxav ql qov fq' outString = 'F xj obxav ql qov fq ' outString = 'F xj obxav ql qov fq -' outString = 'F xj obxav ql qov fq - ' outString = 'F xj obxav ql qov fq - t' outString = 'F xj obxav ql qov fq - tf' outString = 'F xj obxav ql qov fq - tfq' outString = 'F xj obxav ql qov fq - tfqe' outString = 'F xj obxav ql qov fq - tfqe ' outString = 'F xj obxav ql qov fq - tfqe m' outString = 'F xj obxav ql qov fq - tfqe mr' outString = 'F xj obxav ql qov fq - tfqe mrk' outString = 'F xj obxav ql qov fq - tfqe mrkz' outString = 'F xj obxav ql qov fq - tfqe mrkzq' outString = 'F xj obxav ql qov fq - tfqe mrkzqr' outString = 'F xj obxav ql qov fq - tfqe mrkzqrx' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxq' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqf' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqfl' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk ' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk x' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xk' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xka' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xka ' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xka Z' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xka ZX' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xka ZXM' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xka ZXMP' outString = 'F xj obxav ql qov fq - tfqe mrkzqrxqflk xka ZXMP!'

2   Pass
inString1 = 'I am ready to try it - with punctuation and CAPS!'; outString1b = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dqg FDSV!'; assert(isequal(simpleDecoderRing(inString1,3),outString1b ));

outString = 'L' outString = 'L ' outString = 'L d' outString = 'L dp' outString = 'L dp ' outString = 'L dp u' outString = 'L dp uh' outString = 'L dp uhd' outString = 'L dp uhdg' outString = 'L dp uhdgb' outString = 'L dp uhdgb ' outString = 'L dp uhdgb w' outString = 'L dp uhdgb wr' outString = 'L dp uhdgb wr ' outString = 'L dp uhdgb wr w' outString = 'L dp uhdgb wr wu' outString = 'L dp uhdgb wr wub' outString = 'L dp uhdgb wr wub ' outString = 'L dp uhdgb wr wub l' outString = 'L dp uhdgb wr wub lw' outString = 'L dp uhdgb wr wub lw ' outString = 'L dp uhdgb wr wub lw -' outString = 'L dp uhdgb wr wub lw - ' outString = 'L dp uhdgb wr wub lw - z' outString = 'L dp uhdgb wr wub lw - zl' outString = 'L dp uhdgb wr wub lw - zlw' outString = 'L dp uhdgb wr wub lw - zlwk' outString = 'L dp uhdgb wr wub lw - zlwk ' outString = 'L dp uhdgb wr wub lw - zlwk s' outString = 'L dp uhdgb wr wub lw - zlwk sx' outString = 'L dp uhdgb wr wub lw - zlwk sxq' outString = 'L dp uhdgb wr wub lw - zlwk sxqf' outString = 'L dp uhdgb wr wub lw - zlwk sxqfw' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwx' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxd' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdw' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwl' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlr' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq ' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq d' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dq' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dqg' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dqg ' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dqg F' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dqg FD' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dqg FDS' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dqg FDSV' outString = 'L dp uhdgb wr wub lw - zlwk sxqfwxdwlrq dqg FDSV!'

3   Pass
inString2 = 'Dick Tracy is often associated with decoder rings.'; outString2a = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz zqvoa.'; assert(isequal(simpleDecoderRing(inString2,-18),outString2a ));

outString = 'L' outString = 'Lq' outString = 'Lqk' outString = 'Lqks' outString = 'Lqks ' outString = 'Lqks B' outString = 'Lqks Bz' outString = 'Lqks Bzi' outString = 'Lqks Bzik' outString = 'Lqks Bzikg' outString = 'Lqks Bzikg ' outString = 'Lqks Bzikg q' outString = 'Lqks Bzikg qa' outString = 'Lqks Bzikg qa ' outString = 'Lqks Bzikg qa w' outString = 'Lqks Bzikg qa wn' outString = 'Lqks Bzikg qa wnb' outString = 'Lqks Bzikg qa wnbm' outString = 'Lqks Bzikg qa wnbmv' outString = 'Lqks Bzikg qa wnbmv ' outString = 'Lqks Bzikg qa wnbmv i' outString = 'Lqks Bzikg qa wnbmv ia' outString = 'Lqks Bzikg qa wnbmv iaa' outString = 'Lqks Bzikg qa wnbmv iaaw' outString = 'Lqks Bzikg qa wnbmv iaawk' outString = 'Lqks Bzikg qa wnbmv iaawkq' outString = 'Lqks Bzikg qa wnbmv iaawkqi' outString = 'Lqks Bzikg qa wnbmv iaawkqib' outString = 'Lqks Bzikg qa wnbmv iaawkqibm' outString = 'Lqks Bzikg qa wnbmv iaawkqibml' outString = 'Lqks Bzikg qa wnbmv iaawkqibml ' outString = 'Lqks Bzikg qa wnbmv iaawkqibml e' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eq' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqb' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp ' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp l' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lm' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmk' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkw' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwl' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlm' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz ' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz z' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz zq' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz zqv' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz zqvo' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz zqvoa' outString = 'Lqks Bzikg qa wnbmv iaawkqibml eqbp lmkwlmz zqvoa.'

4   Pass
inString2 = 'Dick Tracy is often associated with decoder rings.'; outString2b = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan nejco.'; assert(isequal(simpleDecoderRing(inString2,22),outString2b ));

outString = 'Z' outString = 'Ze' outString = 'Zey' outString = 'Zeyg' outString = 'Zeyg ' outString = 'Zeyg P' outString = 'Zeyg Pn' outString = 'Zeyg Pnw' outString = 'Zeyg Pnwy' outString = 'Zeyg Pnwyu' outString = 'Zeyg Pnwyu ' outString = 'Zeyg Pnwyu e' outString = 'Zeyg Pnwyu eo' outString = 'Zeyg Pnwyu eo ' outString = 'Zeyg Pnwyu eo k' outString = 'Zeyg Pnwyu eo kb' outString = 'Zeyg Pnwyu eo kbp' outString = 'Zeyg Pnwyu eo kbpa' outString = 'Zeyg Pnwyu eo kbpaj' outString = 'Zeyg Pnwyu eo kbpaj ' outString = 'Zeyg Pnwyu eo kbpaj w' outString = 'Zeyg Pnwyu eo kbpaj wo' outString = 'Zeyg Pnwyu eo kbpaj woo' outString = 'Zeyg Pnwyu eo kbpaj wook' outString = 'Zeyg Pnwyu eo kbpaj wooky' outString = 'Zeyg Pnwyu eo kbpaj wookye' outString = 'Zeyg Pnwyu eo kbpaj wookyew' outString = 'Zeyg Pnwyu eo kbpaj wookyewp' outString = 'Zeyg Pnwyu eo kbpaj wookyewpa' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz ' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz s' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz se' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sep' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd ' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd z' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd za' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zay' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zayk' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykz' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykza' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan ' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan n' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan ne' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan nej' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan nejc' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan nejco' outString = 'Zeyg Pnwyu eo kbpaj wookyewpaz sepd zaykzan nejco.'