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

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 03:09C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 03:09018,625,7337,633,0001,039,0002,117,632expected "2 ", got "0 "
2Sep 8, 2026 03:09018,678,1837,646,0001,042,0002,117,632expected "2 ", got "0 "
3Sep 8, 2026 03:09018,690,8867,677,0001,055,0002,117,632expected "2 ", got "0 "
4Aug 21, 2026 15:523,65950,887,83339,160,0001,090,0002,113,536
5Aug 21, 2026 15:523,66150,048,27239,189,0001,084,0002,113,536
6Aug 21, 2026 15:523,66850,131,57039,244,0001,110,0002,113,536
7Aug 21, 2026 15:523,67150,190,07839,286,0001,103,0002,113,536
8Aug 21, 2026 15:523,67250,179,07339,284,0001,115,0002,113,536
9Aug 21, 2026 15:523,67250,142,04339,293,0001,103,0002,113,536
10Aug 21, 2026 15:523,68250,282,22639,444,0001,063,0002,113,536
11Aug 21, 2026 15:523,68350,298,90439,411,0001,102,0002,113,536
12Aug 21, 2026 15:523,70160,051,63139,680,0001,034,0002,113,536