Company: Agoda
Difficulty: medium
1. Simple Cipher A simple cipher is built on the alphabet wheel which has uppercase English letters ['A'-'Z'] written on it: Given an encrypted string consisting of English letters ['A'-'Z'] only, decrypt the string by replacing each character with the k th character away on the wheel in the counter-clockwise direction. Counter-clockwise is the opposite direction in which the hands on a clock usually move. In the image, Z is 1 unit counter-clockwise from A. Function Description Complete the function simpleCipher in the editor below. simpleCipher has the following parameter(s): string encrypted : the string to decrypt int k : the position of the character to find Returns: string : the decrypted string Constraints 1 ≤ |encrypted| ≤ 10 5 1 ≤ k ≤ 10 5 encrypted[i] ∈ ascii['A'-'Z'] Input Format For Custom Testing The first line contains a string, encrypted . The next line contains an integer, k . Sample Cases Sample Case 0 Input: CDEF k = 2 Output: ABCD Each character is replaced by the cha