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:01Andrew EpsteinAndrew EpsteinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 7, 2026 15:47C#_user26.43CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 7, 2026 15:47016,870,7316,892,000020,480No answer to stdout. Died or killed?
2Aug 21, 2026 16:013,31246,273,35935,424,0001,011,0002,113,536
3Aug 21, 2026 16:013,32546,375,70535,487,0001,098,0002,113,536
4Aug 21, 2026 16:013,32847,553,18635,599,0001,017,0002,113,536
5Aug 21, 2026 16:013,33046,418,98535,541,0001,096,0002,113,536
6Aug 21, 2026 16:013,33847,267,26135,624,0001,100,0002,113,536
7Aug 21, 2026 16:013,33846,544,25935,613,0001,105,0002,113,536
8Aug 21, 2026 16:013,33846,512,56935,719,0001,003,0002,113,536
9Aug 21, 2026 16:013,34046,486,83235,660,0001,085,0002,113,536
10Aug 21, 2026 16:013,34646,562,21635,776,0001,034,0002,113,536