Parse JSON Sergey Svistunov

Compute the total amount of non-canceled external USD transactions from a stream of JSON records as fast as possible.

Input: 1 000 000 JSON records on STDIN, one per line. Each record has the following structure:

{
    "user_id": 0,
    "currency": "USD",
    "transactions": [
        {
            "amount": 0,
            "to_user_id": 0,
            "canceled": false
        }
    ]
}
Field Constraints
user_id Integer, max 10 000
currency One of "GBP", "USD", "RUB", "JPY", "CHF"
transactions Array, max 10 elements
amount Integer, max 1000
canceled Boolean; may be omitted when false

Field order is not guaranteed within any object.

Output: The total amount of all transactions where:

  • record.currency == "USD"
  • transaction.to_user_id != record.user_id (external)
  • transaction.canceled is false or absent
Back to listAug 16, 2026 23:09Tomislav TunkovicTomislav TunkovicError
Source Code

Source code access is restricted. Log in to request access.

Challenge History
DateChallengerCostTypeStatus
Sep 7, 2026 17:41C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 7, 2026 17:41018,097,7988,137,000028,672Exit with code 101: thread 'main' (1) panicked at main.rs:277:17: index out of bounds: the len is 16 but the index is 16 note: run with `RUST_BACKTRACE=1` environment variable to display a backtracestderr
2Aug 17, 2026 03:161,96931,541,78521,666,000024,576
3Aug 17, 2026 03:161,97231,559,16121,694,000024,576
4Aug 17, 2026 03:161,97731,613,67621,754,000024,576
5Aug 17, 2026 03:161,97831,653,60921,766,000024,576
6Aug 17, 2026 03:161,97931,647,92420,770,0001,005,00024,576
7Aug 17, 2026 03:161,99031,754,78021,896,000024,576
8Aug 17, 2026 03:161,99531,816,91021,946,000024,576
9Aug 17, 2026 03:161,99731,858,48321,970,000024,576
10Aug 17, 2026 03:162,06432,600,17522,712,000024,576