Build an app take-home "challenge".
Implement autocomplete(words, queries, k). words is a list of [word, frequency] pairs, and each query returns up to k matching words. Rank matches by descending frequency, then lexicographic order; if the query exactly matches a submitted word, return only that word.
Signature: def autocomplete(words, queries, k):. Return a list of result lists in query order.
def autocomplete(words, queries, k):