← Back to problems LC 1268 →

Search Suggestions System

LeetCode 1268 • Medium • Tries • Anduril

products sorted; for each growing prefix of searchWord, return up to 3 lexicographically smallest matches.

TimeO(n log n + m·n)
SpaceO(1)
Suggestion
step
note
Ready
Press Play to walk the algorithm.