Loading Now

keyboardLayout

There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.

You are given two strings k1, k2 consisting of 26 distinct letters each: all keys of the first and the second layouts in the same order.

You are also given some text t consisting of small and capital English letters and digits. It is known that it was typed in the first layout, but the writer intended to type it in the second layout. Print the text if the same keys were pressed in the second layout.

Since all keys but letters are the same in both layouts, the capitalization of the letters should remain the same, as well as all other characters.

Your task is write a function return the text if the same keys were pressed in the second layout.

Example

  • For k1 = "qwertyuiopasdfghjklzxcvbnm", k2 = "veamhjsgqocnrbfxdtwkylupzi", t = "Apjwcweds", the output should be keyboardLayout(k1, k2, t) = "Codelearn"

Input/Output

  • [Execution time limit] 0.5 seconds

  • [Input] string k1, k2, t

    Guaranteed constraints:
    |k1| = |k2| = 26
    1 <= |t| <= 500
  • [Output] string

Post Comment

Contact