your shift key is broken. wheNever you type two lines, the cApitaL
LetteRs in them get swappeD. you must write a program to fiX THIS!
The input is two strings,
s2, equal in length. They will each contain only printable ASCII and be at least one character in length. You may input these as two strings, an array of two strings, or a single string with
s2 separated by either a tab or newline.
The output is the following:
For each character
If the character is not a letter, output it unchanged.
cis a letter:
Find the matching character (the one at the same index) in
If it is a capital letter, output
If it is a lowercase letter, output
Then do the same thing, except with
Essentially, all letters in
s1 for which the matching character in
s2 is capital should be capitalized, and all letters in
s1 with a lowercase letter at the same index in
s2 should become lowercase (and vice versa).
PRogrammiNG puzZLes & CODe golf SdlkhkfaladlKsdlalksdg7ldklDgsl
Programming Puzzles & Code Golf SDlkhkfalADlksdLAlksdg7LDkldgsl