Leetcode 2227. Encrypt and Decrypt Strings
Implement an Encrypter that maps each character to a two-letter code and supports encrypting by replacing characters and decrypting by counting how many dictionary words could produce a given encoded string. The core challenge is handling ambiguous (non-unique) code-to-char mappings efficiently, typically solved with a reverse map from codes to possible chars plus a trie or backtracking over 2-letter segments to count valid dictionary matches.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.