Handle Prefixes
Mediumtriestrings
The friend search box suggests handles as you type. handles lists every handle on the server (handles may repeat; each copy counts). For each string in prefixes, return how many handles start with it. The empty prefix matches every handle.
The largest test has 20,000 handles and 20,000 prefixes.
Examples
Input: handles = ["ace","acorn","bolt","ace"], prefixes = ["ac","ace","b","z"]
Output: [3,2,1,0]