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 21, 2026 16:09Andrew EpsteinAndrew EpsteinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 7, 2026 17:40C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 7, 2026 17:40037,028,82927,253,000016,384No answer to stdout. Died or killed?
2Aug 21, 2026 16:103,36446,808,67635,920,0001,091,0002,113,536
3Aug 21, 2026 16:103,38046,959,53836,093,0001,096,0002,113,536
4Aug 21, 2026 16:103,38446,967,93136,116,0001,116,0002,113,536
5Aug 21, 2026 16:103,38947,038,66036,192,0001,087,0002,113,536
6Aug 21, 2026 16:103,38947,901,57036,178,0001,108,0002,113,536
7Aug 21, 2026 16:103,39247,118,41036,230,0001,090,0002,113,536
8Aug 21, 2026 16:103,39847,062,08936,293,0001,086,0002,113,536
9Aug 21, 2026 16:103,39947,156,91436,305,0001,087,0002,113,536
10Aug 21, 2026 16:103,40047,185,08036,357,0001,044,0002,113,536