Detect Duplicate Transactions
Medium📝 Description
Flag transactions with the same amount and recipient within 10 minutes.
Input Format
[{"time": str (HH:MM), "amount": float, "recipient": str}]
Output Format
[{"transaction": dict, "is_duplicate": bool}]
Constraints
1 ≤ transactions ≤ 10^4, 0 < amount ≤ 10^6
🔍 Sample Input
[{"time": "10:00", "amount": 100, "recipient": "Alice"}, {"time": "10:05", "amount": 100, "recipient": "Alice"}]
✅ Sample Output
[{"transaction": {"time": "10:05", "amount": 100, "recipient": "Alice"}, "is_duplicate": true}]
Code Editor
Please login to run and submit code.
Results
Suggested Solution
Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run