Learn Trie and solve three corresponding problems