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 24, 2026 09:54Victor MerckléVictor MerckléError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 4, 2026 23:40Tomislav Tunkovic10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 5, 2026 01:1109,288,3991,227,000016,384No answer to stdout. Died or killed?
2Aug 24, 2026 09:541,85828,565,62320,439,00002,117,632stderr
3Aug 24, 2026 09:541,86028,463,49620,464,00002,117,632stderr
4Aug 24, 2026 09:541,86228,469,46920,491,00002,117,632stderr
5Aug 24, 2026 09:541,86328,450,81120,495,00002,117,632stderr
6Aug 24, 2026 09:541,86628,554,01320,536,00002,117,632stderr
7Aug 24, 2026 09:541,86728,513,72720,546,00002,117,632stderr
8Aug 24, 2026 09:541,86728,669,55720,540,00002,117,632stderr
9Aug 24, 2026 09:541,86928,605,81520,568,00002,117,632stderr
10Aug 24, 2026 09:541,88128,797,39019,687,0001,014,0002,117,632stderr