An autocomplete system that provides suggestions based on a prefix input. The system should allow the insertion of words and dynamically update the weight of each word (i.e., how frequently the word is used). Suggestions should be returned in decreasing order of weight.
Problem: The Trie data structure efficiently stores and retrieves words based on a prefix. By associating a weight with each word and dynamically updating it, this system provides weighted autocomplete suggestions, making it more intelligent over time.
Edge Cases:
- Empty prefix input.
- Handling words with the same prefix.
- Inserting invalid or empty words.
Can you please Assign this task to me under HactoberFest 2024.