Prefix Word Search Data Structure

Given a list of lowercase words, build a data structure supporting search(prefix), which returns every word beginning with prefix in lexicographic order. Use a Trie.

The total number of character...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: