← 返回 amazon 的题目列表Log Stream Processing
类型:online_judge
Given a stream of logs where each entry contains a customer, an item, and a timestamp, design an algorithm to calculate the top k items in any given time range.
Example
Input
[("cust1", "item1", 1599999900), ("cust2", "item2", 1600000000), ("cust3", "item1", 1600000100)], 1599999900, 1600000100, 1