Search History-Based Auto-Complete

Solve a hard-level problem for designing search auto-complete that suggests keywords based on search history using tries.

Problem statement

Design and implement an auto-complete system that returns the top three "hot" suggestions based on historical searches. The suggestions must be in lexicographical order. The degree of hotness of a search suggestion is the number of times a user typed the same sentence before. The input is a character array.

Example

Sample input

Get hands-on with 1200+ tech skills courses.