Duolingo Interview Question

Encrypt and decrypt a string with only lower-case English letters according to a dictionary.

Interview Answer

Anonymous

Nov 4, 2021

For string encryption, just iterate the string and follow the dictionary, return an encrypted string. For decryption, there might be different ways to decrypt since the mapping may be one-to-many. So DFS for each possible way.