Company: Tekion_SDE intern_On-campus_3july
Difficulty: medium
A messaging system encrypts text using a circular substitution rule. All 26 lowercase English letters are arranged in a circular sequence in some unknown order. Each letter is encrypted by replacing it with the letter in the circle when moving clockwise. You are given the encrypted message. Your task is to determine the lexicographically smallest original message that could have produced the encrypted message under some valid circular arrangement of all 26 lowercase English letters. A valid arrangement must satisfy: every lowercase English letter appears exactly once no letter maps to itself the mapping forms one single cycle of length 26 Function Description Complete the function cipherRecovery. Function Parameters vector<string> encryptedMessages — each string is one encrypted message Returns vector<string> — for each encrypted message, return the lexicographically smallest possible original message Constraints 1 ≤ t ≤ 30000 1 ≤ length ≤ 100000 sum of lengths over all tes