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 22:44olliecrowolliecrowScore: 3,634Success
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 22:443,62570,133,44838,880,000996,0002,392,064
2Feb 13, 2026 22:443,62864,317,90537,911,0001,995,0002,277,376
3Feb 13, 2026 22:443,63059,241,25437,931,0001,996,0002,396,160
4Feb 13, 2026 22:443,63065,787,02738,931,000998,0002,400,256
5Feb 13, 2026 22:443,63465,279,83637,977,0001,998,0002,277,376
6Feb 13, 2026 22:443,63964,774,01339,024,0001,000,0002,404,352
7Feb 13, 2026 22:443,64262,827,35938,056,0002,002,0002,277,376
8Feb 13, 2026 22:443,64261,564,07838,064,0002,003,0002,277,376
9Feb 13, 2026 22:443,64365,812,50038,072,0002,003,0002,387,968