Practice Invalid Transactions
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Each transactions[i] is a comma-separated string containing a name, a time in minutes, an amount, and a city. A transaction is possibly invalid if its amount exceeds 1000, or if another transaction with the same name occurs in a different city within 60 minutes, including exactly 60 minutes. Return every possibly invalid transaction in any order.
Source: Invalid Transactions on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
transactions = ["alice,20,800,mtv","alice,50,100,beijing"]
["alice,20,800,mtv","alice,50,100,beijing"]
# Example 2
transactions = ["alice,20,800,mtv","alice,50,1200,mtv"]
["alice,50,1200,mtv"]
# Example 3
transactions = ["alice,20,800,mtv","bob,50,1200,mtv"]
["bob,50,1200,mtv"]
Constraints
Related LeetCode Problems
Practice more problems similar to Invalid Transactions.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.