TikTok Interview Question

Self introduction, then solve a dictionary tree problem. I solved it with trie.