Algorithm · Roblox · Hard
Build an autocomplete service that draws its suggestions from a log of past searches. You receive five inputs: searchQueries: the strings that users searched for in the past. searchTimestamps: the time of each search; this array has exactly as many entries as searchQueries. prefixes: the prefixes typed in each autocomplete request. prefixTimestamps: the time at which each request was made; this array has exactly as many entries as prefixes. resultCount: the largest number of…