The question needs to specify clearly how to handle duplicate dictionary entries, e.g. if the dictionary is [‘test’, ‘test’, ‘test’, ‘test’].
I know that one of the test cases is exactly this and the answer given treats duplicates as unique words; however, this doesn’t make sense.
Agreed. Also, pedagogically it’d make sense to put this question before Autocomplete, because Prefix Count is an easier trie-type problem.