InterviewDB Question

Tree of Characters: Build a Trie from a Word List and Support Prefix Search and Word Existence Queries

Question Details

Problem Build a Trie (prefix tree) that supports: insert(word) -- add a word. search(word) -> bool -- return True if the word exists. starts_with(prefix) -> bool -- return True if any word starts with the prefix. words_with_prefix(prefix) -> list[str…

Full Details

🔒

Unlock full leaked content

Full insider details, leaked discussions, and candidate experiences.

Get Premium →

Topics

Coding Onsite