Spring Hire Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
08
:
03
:
11
:
11
Back to Dashboard
Product Search Engine
Medium
FREE
Design a ProductSearch class for a product catalog search engine. The constructor takes a list of product names. The search(keyword) method returns all product names where at least one word starts with the given keyword (case-insensitive). Results should be sorted by the position of the earliest matching word (0-indexed, lower position ranks first). Break ties among products alphabetically. Optimize for repeated search calls on the same catalog.
...