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 28, 2026 19:49olliecrowolliecrowScore: 17,331Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2026 19:5217,311198,745,259189,419,0001,002,0002,375,680
2Apr 28, 2026 19:5217,311198,710,032188,427,0002,004,0002,371,584
3Apr 28, 2026 19:5217,319208,826,250188,512,0002,005,0002,334,720
4Apr 28, 2026 19:5217,325198,736,256188,576,0002,006,0002,375,680
5Apr 28, 2026 19:5217,331198,930,769189,644,0001,003,0002,359,296
6Apr 28, 2026 19:5217,336198,913,357189,697,0001,003,0002,514,944
7Apr 28, 2026 19:5217,349199,012,202189,844,000999,0002,375,680
8Apr 28, 2026 19:5217,391198,626,127189,292,0002,013,0002,355,200
9Apr 28, 2026 19:5217,420198,972,215188,612,0003,009,0002,379,776