A lot of good front end questions and a realistic code assignment
Implement a frontend autocomplete utility that returns up to k unique terms within a specified Levenshtein edit distance from a query. Use a trie to share prefix work, rank results by edit distance, and break ties lexicographically. The function receives a list of terms, a query, max_edits, and k, and returns a list of matching strings.
def fuzzy_suggestions(terms, query, max_edits, k):