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:33Victor MerckléVictor MerckléError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 05:33C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 05:34038,827,32129,220,0001,231,0002,134,016expected "2 ", got "4294971653965428 "stderr
2Sep 8, 2026 05:34038,674,42429,061,0001,238,0002,134,016expected "2 ", got "4294971653965428 "stderr
3Sep 8, 2026 05:34038,457,33828,864,0001,241,0002,179,072expected "2 ", got "4294971653965428 "stderr
4Aug 18, 2026 02:372,18632,368,20123,011,0001,041,0002,174,976stderr
5Aug 18, 2026 02:372,19332,785,77722,833,0001,290,0002,134,016stderr
6Aug 18, 2026 02:372,19532,831,08322,868,0001,282,0002,134,016stderr
7Aug 18, 2026 02:372,19532,427,26822,857,0001,298,0002,134,016stderr
8Aug 18, 2026 02:372,19732,524,39123,143,0001,032,0002,134,016stderr
9Aug 18, 2026 02:372,19832,799,61423,159,0001,029,0002,134,016stderr
10Aug 18, 2026 02:372,20032,560,72922,905,0001,296,0002,134,016stderr
11Aug 18, 2026 02:372,20132,655,05423,184,0001,034,0002,179,072stderr
12Aug 18, 2026 02:372,20232,824,00822,930,0001,298,0002,134,016stderr