Design a system to analyze two days of purchase logs and compute trust scores for new purchases.
Implement the PurchaseAnalyzer class:
-
PurchaseAnalyzer(logsDay1: List[List[str]], logsDay2: List[List[str]])Build per-user history from two days of logs. Each log row is[date, userId, orderType, amount], whereamountis string. -
List[str] crossDayDiverseUsers()Return the lexicographically-sorted list of userIds that- appear in both days, and
- have at least two distinct
orderTypeacross the two days combined.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected