Sponsored
Use these hints if you're stuck. Try solving on your own first.
For encryption, use hashmap to map each char of word1 to its value.
For decryption, use trie to prune when necessary.
Solve with full IDE support and test cases