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 listFeb 13, 2026 20:44olliecrowolliecrowScore: 3,807Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 13, 2026 20:443,80469,164,12839,848,0001,992,0002,404,352
2Feb 13, 2026 20:443,80571,740,23639,862,0001,993,0002,383,872
3Feb 13, 2026 20:443,80572,423,12740,862,000996,0002,400,256
4Feb 13, 2026 20:443,80766,267,28640,856,0001,021,0002,277,376
5Feb 13, 2026 20:443,80765,708,09439,885,0001,994,0002,396,160
6Feb 13, 2026 20:443,80864,187,19140,887,000997,0002,514,944
7Feb 13, 2026 20:443,81564,795,32740,962,000999,0002,400,256
8Feb 13, 2026 20:443,81563,801,10340,971,000999,0002,400,256
9Feb 13, 2026 20:443,82168,774,79640,031,0002,001,0002,277,376