You are in fact writing an interpreter for the language "Wrong keyboard position". You can pretend that you are not doing this and just follow the instructions below.

I typr re;atively accuratrly, but so,etimes I made a whole nlock of text illegible by shifting a key right. So I need a program that corrects my text back to its original meaning.


  • You have to left shift on a standard English QWERTY keyboard.
  • Whitespace do not count for the procedure before left-shifting and are kept as-is in a standard left-shifting procedure. If the key is the leftmost letter/symbol on a keyboard(i.e. The ~key, Q key, A key, Z key.), the key is kept as-is. If you reach a control character while left-shifting (Caps lock and Shift), their effects will not be triggered and the character before left-shifting is kept.
  • This is a contest; the shortest answer wins.
  • Both the input and the output shall be given via our default methods.

Representation of a subset of the QWERTY keyboard that you will need

The two lines connected are possible values of the key: shifted/unshifted.







The input will always be a non-empty string conforming the rules above.


The output will be the input string corrected to the originally intended meaning.


Yjod ,sfr yjr, imjsppu/ -> This made them unhaooy.
vpfr hp;g -> code golf
  • 1
    \$\begingroup\$ Test case fixed. \$\endgroup\$ – a'_' Sep 10 '19 at 11:19
  • \$\begingroup\$ I ported my solution with almost no change, so I'm gonna agree with the duplicate vote. \$\endgroup\$ – Grimmy Sep 10 '19 at 12:59

05AB1E, 59 bytes

-1 byte thanks to Kevin Cruijssen

žVDu«1ú`žhÀ“~!@#$%^&*()_+ `ÿ-=ÿ<>?ÿ:"ÿ{}|ÿ,./ÿ;'ÿ[]\“#vy¦y‡

Try it online!

  • 1
    \$\begingroup\$ -1 using žhÀ instead of 9LJ, so the 0 inside the string can be removed (same applies to your other answer) \$\endgroup\$ – Kevin Cruijssen Sep 11 '19 at 6:19
  • \$\begingroup\$ @KevinCruijssen updated both, thanks! \$\endgroup\$ – Grimmy Sep 11 '19 at 10:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.