Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1804. Implement Trie II (Prefix Tree)
Design a prefix tree that supports insert, countWordsEqualTo, countWordsStartingWith, and erase operations, handling duplicate inserts/removals by maintaining node-level occurrence counts. Each operation should run in O(length of word or prefix) time by walking and updating counts along the trie path.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.