Typeahead suggestions
A search box suggests words as you type. Given a dictionary words and the string typed, return one list per character typed: after the first i characters, the up to 3 alphabetically smallest words that start with typed[:i], in alphabetical order. A word repeated in words is suggested once, and a word equal to the prefix counts as a match.
Words and typed use lowercase a–z; 1 ≤ len(typed) ≤ 20.
Examples
suggestions(["apple","apply","ape","april","bat","apt"], "apr")→[["ape","apple","apply"],["ape","apple","apply"],["april"]]suggestions(["tea","ten","toe"], "tx")→[["tea","ten","toe"],[]]suggestions(["go","go","gone","good"], "go")→[["go","gone","good"],["go","gone","good"]]