1949. Implement Trie II (Prefix Tree)

Medium
Hash Table
String
Design
Trie

Description

Hints

Hint 1
Try to solve the first version first and reuse your code.
Hint 2
To implement the delete function, you should delete the trie nodes of the word if they are not shared with other words.
Hint 3
You should keep for each trie node a counter of how many words share this node.

Statistics

Acceptance
63.2%
Submissions
41,574
Accepted
26,268