Build a prefix index over words, each with a popularity score, then answer queries: for each prefix,
return up to k words starting with it, by score descending then alphabetically. Matching is
case-insensitive; return words lowercased. A word listed twice keeps its highest score.
Implement autocomplete. Input: words: list[[str, int]], queries: list[str], k: int. Returns: list[list[str]].
def autocomplete(words: list[list], queries: list[str], k: int) -> list[list[str]]:
return [[] for _ in queries]
Run executes the public tests. Submit grades against public and hidden tests.
Build a prefix index over words, each with a popularity score, then answer queries: for each prefix,
return up to k words starting with it, by score descending then alphabetically. Matching is
case-insensitive; return words lowercased. A word listed twice keeps its highest score.
Implement autocomplete. Input: words: list[[str, int]], queries: list[str], k: int. Returns: list[list[str]].
def autocomplete(words: list[list], queries: list[str], k: int) -> list[list[str]]:
return [[] for _ in queries]
Run executes the public tests. Submit grades against public and hidden tests.