Spring Hire Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
08
:
04
:
48
:
40
Back to Dashboard
Prune Prefix Words
Medium
A URL shortener system maintains a keyword list. To reduce redundancy, remove every keyword that is a prefix of any other keyword in the list. A string a is a prefix of string b if b starts with a and len(a) < len(b). Return only the keywords that are not a prefix of any other keyword, preserving their original relative order.
Function: pruneKeywords(keywords: list<string>) -> list<string>
...