← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given three arrays:
queries[i] is a search query issued by a user.timestamps[i] is the time when queries[i] was issued.prefixes[j] is a prefix typed into an autocomplete box.
For each prefix, return every distinct query that starts with that prefix, ordered by:k suggestions.roblox and roblox studio each appear twice, so the earlier first timestamp puts roblox first. roblox game appears once.
Both queries appear twice. alpha has earliest timestamp 2, while alpine has earliest timestamp 3.
The count and earliest timestamp both tie, so lexicographic order breaks the tie.