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 14, 2026 17:03marko1597marko1597Error
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 4, 2026 18:58Tomislav Tunkovic18.15CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 4, 2026 19:01054,902,93545,531,0001,022,0002,117,632expected "404580433 ", got "340187991 "
2Sep 4, 2026 19:01055,008,31445,619,0001,045,0002,117,632expected "404675078 ", got "340586718 "
3Sep 4, 2026 19:01055,068,30345,597,0001,024,0002,117,632expected "406410291 ", got "341918391 "
4Aug 14, 2026 17:044,15854,167,89244,699,0001,044,0002,117,632
5Aug 14, 2026 17:044,16054,158,08444,732,0001,038,0002,117,632
6Aug 14, 2026 17:044,16154,144,51144,743,0001,033,0002,117,632
7Aug 14, 2026 17:044,16154,070,46144,741,0001,034,0002,117,632
8Aug 14, 2026 17:044,16254,034,42444,761,0001,023,0002,117,632
9Aug 14, 2026 17:044,16454,154,17544,790,0001,019,0002,117,632
10Aug 14, 2026 17:044,16554,162,27344,806,0001,017,0002,117,632
11Aug 14, 2026 17:044,16754,204,73144,809,0001,028,0002,117,632
12Aug 14, 2026 17:044,18255,605,31044,958,0001,048,0002,117,632