StringBuilder VI
Another problem where using String leads to a time limit exceeded, but StringBuilder (just for the token processing) does the trick. Just some calculation is needed for the characters rotation. Code is down below, cheers, ACC. Decrypt the Message - LeetCode You are given a string s representing an encrypted message consisting of one or more tokens. Each token consists of lowercase English letters, followed by '#' and an integer representing its encryption key. The tokens are separated by single spaces. To decrypt a token, shift each letter backward by the number of positions specified by its key. The alphabet wraps around, so shifting 'a' backward by one position produces 'z' . Return the decrypted message , with the keys removed and the decrypted words in their original order, separated by single spaces. Example 1: Input: s = "abc#1" Output: "zab" Explanation: The token "abc#1" has a key of 1, so each letter is shifted ba...