← 返回 bloomberg 的题目列表Reordered Transaction List
类型:online_judge
Given a list of strings transactions, where each string represents a transaction record in the format: "name,time,amount,city". The transaction times are in ascending order. Filter out the invalid transactions and generate a new list. Invalid transactions are defined as: 1. The transaction amount exceeds 1000. 2. Within 60 minutes, a transaction by the same user in a different city. The solution should have a time complexity of O(n).
Example
Input
["alice,20,800,mtv","bob,50,1200,ny","alice,60,100,mtv","alice,88,1200,beijing"]