about | help | code help+videos | done | prefs |
(MEDIUM) Given an input String and a 26-character key String, encode the input by substituting each letter of the input with the character having the same index ('A'==0, 'B'==1, ..., 'Z'==25) from the key. Precondition: no lowercase letters in the plaintext, but non-letter characters are allowed and will not be substituted in the output. Note that the keys will have non-letter characters as well however, meaning that the output will have an increased number of non-letter characters as a result. apcsaEncryptSubstitutionKey("ABCDE", "ZYXWVUTSRQPONMLKJIHGFEDCBA") → "ZYXWV" apcsaEncryptSubstitutionKey("HELL HATH NO FURY LIKE A SEMICOLON SCORNED", "ZYXWVUTSRQPONMLKJIHGFEDCBA") → "SVOO SZGS ML UFIB ORPV Z HVNRXLOLM HXLIMVW" apcsaEncryptSubstitutionKey("HELL HATH NO FURY LIKE A SEMICOLON SCORNED", "ABCDEFGHIJKLMNOPQRSTUVWXYZ") → "HELL HATH NO FURY LIKE A SEMICOLON SCORNED" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 310
Copyright Nick Parlante 2017 - privacy