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 18, 2026 02:46Victor MerckléVictor MerckléError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 05:03C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 05:06039,550,01428,244,0001,003,0002,121,728expected "2 ", got "4294971653965428 "stderr
2Sep 8, 2026 05:06037,658,27428,212,0001,017,0002,121,728expected "2 ", got "4294971653965428 "stderr
3Sep 8, 2026 05:06038,117,61128,656,0001,039,0002,121,728expected "2 ", got "4294971653965428 "stderr
4Aug 18, 2026 03:172,10431,669,58122,140,0001,009,0002,121,728stderr
5Aug 18, 2026 03:172,10931,636,60222,119,0001,083,0002,121,728stderr
6Aug 18, 2026 03:172,11031,550,00222,153,0001,060,0002,121,728stderr
7Aug 18, 2026 03:172,11033,378,90122,133,0001,078,0002,121,728stderr
8Aug 18, 2026 03:172,11031,712,90622,158,0001,061,0002,121,728stderr
9Aug 18, 2026 03:172,11031,963,08822,137,0001,082,0002,121,728stderr
10Aug 18, 2026 03:172,11231,519,70222,181,0001,058,0002,121,728stderr
11Aug 18, 2026 03:172,11335,107,05922,118,0001,130,0002,121,728stderr
12Aug 18, 2026 03:172,11631,582,65022,229,0001,048,0002,121,728stderr