Tap here to switch tabs
Problem
Submissions

Problem: Invalid Transactions

med
30 min
Try to solve the Invalid Transactions problem.

Statement

You are given an array of transaction strings transactions where each transaction transactions[i] is formatted as a comma separated string "{name},{time},{amount},{city}".

A transaction is considered invalid if:

  • The amount strictly exceeds $\10001000, or

  • It takes place within 6060 minutes (inclusive) of another transaction with the same name occurring in a different city.

Return a list of all invalid transactions. You may return the results in any order.

Constraints:

  • transactions.length ≤1000\leq 1000

  • Each transactions[i] takes the form "{name},{time},{amount},{city}"

  • Each name and city consists of lowercase English letters and has a length between 11 and 1010

  • Each time consists of digits and represents an integer between 00 and 10001000

  • Each amount consists of digits and represents an integer between 00 and 20002000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Invalid Transactions

med
30 min
Try to solve the Invalid Transactions problem.

Statement

You are given an array of transaction strings transactions where each transaction transactions[i] is formatted as a comma separated string "{name},{time},{amount},{city}".

A transaction is considered invalid if:

  • The amount strictly exceeds $\10001000, or

  • It takes place within 6060 minutes (inclusive) of another transaction with the same name occurring in a different city.

Return a list of all invalid transactions. You may return the results in any order.

Constraints:

  • transactions.length ≤1000\leq 1000

  • Each transactions[i] takes the form "{name},{time},{amount},{city}"

  • Each name and city consists of lowercase English letters and has a length between 11 and 1010

  • Each time consists of digits and represents an integer between 00 and 10001000

  • Each amount consists of digits and represents an integer between 00 and 20002000