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 18:46marko1597marko1597Error
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 4, 2026 18:37Tomislav Tunkovic27.35CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 4, 2026 18:51047,226,99337,747,0001,027,0002,117,632expected "403502670 ", got "339668368 "
2Sep 4, 2026 18:51047,361,52337,892,0001,038,0002,117,632expected "406236650 ", got "342074043 "
3Sep 4, 2026 18:51047,269,97737,771,0001,026,0002,117,632expected "404116840 ", got "340321762 "
4Aug 14, 2026 18:493,49346,858,22937,408,0001,022,0002,117,632
5Aug 14, 2026 18:493,49447,575,07537,435,0001,009,0002,117,632
6Aug 14, 2026 18:493,50046,929,18037,417,0001,090,0002,117,632
7Aug 14, 2026 18:493,50146,929,19337,454,0001,057,0002,117,632
8Aug 14, 2026 18:493,50246,945,42437,505,0001,023,0002,117,632
9Aug 14, 2026 18:493,50246,883,73437,419,0001,106,0002,117,632
10Aug 14, 2026 18:493,50446,954,18637,454,0001,095,0002,117,632
11Aug 14, 2026 18:493,50946,995,63237,587,0001,020,0002,117,632
12Aug 14, 2026 18:493,51848,211,71737,678,0001,024,0002,117,632