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

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

Challenge History
DateChallengerCostTypeStatus
Sep 9, 2026 09:33C#_user11.11CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 9, 2026 09:33017,602,6927,959,0001,065,0002,117,632expected "2 ", got "58 "
2Sep 9, 2026 09:33017,468,3057,936,0001,103,0002,117,632expected "2 ", got "58 "
3Sep 9, 2026 09:33017,328,3087,931,0001,063,0002,117,632expected "2 ", got "58 "
4Aug 14, 2026 17:413,97152,027,24442,659,0001,031,0002,117,632
5Aug 14, 2026 17:413,97551,988,50042,688,0001,043,0002,117,632
6Aug 14, 2026 17:413,97652,076,95742,688,0001,051,0002,117,632
7Aug 14, 2026 17:413,97852,000,85842,745,0001,023,0002,117,632
8Aug 14, 2026 17:413,97853,301,15942,735,0001,025,0002,117,632
9Aug 14, 2026 17:413,97952,095,20942,708,0001,064,0002,117,632
10Aug 14, 2026 17:413,98452,210,57342,816,0001,008,0002,117,632
11Aug 14, 2026 17:413,98452,139,08042,803,0001,030,0002,117,632
12Aug 14, 2026 17:413,98552,964,83242,820,0001,020,0002,117,632