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 listApr 30, 2026 20:19Charles CabergsCharles CabergsScore: 5,067Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 30, 2026 20:205,03370,754,06954,359,0001,006,0002,506,752
2Apr 30, 2026 20:205,03871,840,82754,418,0001,007,0002,510,848
3Apr 30, 2026 20:205,05876,501,31054,627,0001,011,0002,514,944
4Apr 30, 2026 20:205,06367,346,14154,686,0001,012,0002,326,528
5Apr 30, 2026 20:205,06776,863,95854,725,0001,013,0002,527,232
6Apr 30, 2026 20:205,06971,363,35052,782,0002,987,0002,523,136
7Apr 30, 2026 20:205,07379,623,48453,814,0001,993,0002,531,328
8Apr 30, 2026 20:205,07672,605,22853,847,0001,994,0002,527,232
9Apr 30, 2026 20:205,07773,475,79353,863,0001,994,0002,514,944