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 17, 2026 23:40Victor MerckléVictor MerckléError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 05:36C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 05:37042,956,65829,977,0001,027,0002,134,016expected "2 ", got "4294971653965428 "stderr
2Sep 8, 2026 05:37040,811,63330,016,0001,022,0002,134,016expected "2 ", got "4294971653965428 "stderr
3Sep 8, 2026 05:37042,394,99929,981,0001,026,0002,138,112expected "2 ", got "4294971653965428 "stderr
4Aug 17, 2026 23:562,19733,927,55623,116,0001,053,0002,179,072stderr
5Aug 17, 2026 23:562,20333,929,34823,202,0001,036,0002,134,016stderr
6Aug 17, 2026 23:562,20434,451,63423,205,0001,039,0002,179,072stderr
7Aug 17, 2026 23:562,20534,104,27223,196,0001,059,0002,134,016stderr
8Aug 17, 2026 23:562,21434,081,07423,297,0001,063,0002,179,072stderr
9Aug 17, 2026 23:562,22434,198,25823,426,0001,045,0002,134,016stderr
10Aug 17, 2026 23:562,22434,184,21823,433,0001,033,0002,138,112stderr
11Aug 17, 2026 23:562,22534,507,57423,427,0001,048,0002,138,112stderr
12Aug 17, 2026 23:562,22534,253,09623,438,0001,038,0002,138,112stderr