Their constructor also takes k and search returns top k results.
Your search results should contain the prefix, don't need to return results as if every letter was being typed like LC question asks
Tips: Do not store results in every node (as leetcode solution may suggest) as you insert if you go with trie tree, but instead search up to the word in trie tree. Then recursively find the rest below that node until k elements are reached, similar LC. Add a cache so subsequent search requests don't need to search trie tree.