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

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 05:38C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 05:39039,010,53529,337,0001,224,0002,134,016expected "2 ", got "4294971653965428 "stderr
2Sep 8, 2026 05:39039,198,74029,514,0001,248,0002,134,016expected "2 ", got "4294971653965428 "stderr
3Sep 8, 2026 05:39039,256,30629,510,0001,256,0002,134,016expected "2 ", got "4294971653965428 "stderr
4Aug 18, 2026 01:262,21333,075,59423,063,0001,282,0002,179,072stderr
5Aug 18, 2026 01:262,21332,669,69523,323,0001,029,0002,134,016stderr
6Aug 18, 2026 01:262,22034,191,31923,127,0001,301,0002,179,072stderr
7Aug 18, 2026 01:262,22232,790,42923,161,0001,291,0002,134,016stderr
8Aug 18, 2026 01:262,22532,871,13923,441,0001,035,0002,134,016stderr
9Aug 18, 2026 01:262,22732,871,31223,194,0001,303,0002,134,016stderr
10Aug 18, 2026 01:262,23032,712,37123,235,0001,301,0002,134,016stderr
11Aug 18, 2026 01:262,23832,918,28123,534,0001,087,0002,134,016stderr
12Aug 18, 2026 01:262,27144,755,71123,871,0001,116,0002,134,016stderr