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

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

Challenge History
DateChallengerCostTypeStatus
Sep 9, 2026 09:33C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 9, 2026 09:33017,503,5607,962,0001,065,0002,117,632expected "2 ", got "75614208 "
2Sep 9, 2026 09:33017,509,4817,935,0001,108,0002,117,632expected "2 ", got "75614208 "
3Sep 9, 2026 09:33017,481,6967,918,0001,065,0002,117,632expected "2 ", got "75614208 "
4Aug 14, 2026 14:484,49057,690,90948,363,0001,032,0002,117,632
5Aug 14, 2026 14:484,49357,679,57748,350,0001,083,0002,117,632
6Aug 14, 2026 14:484,49557,845,20048,403,0001,049,0002,117,632
7Aug 14, 2026 14:484,50157,745,21648,406,0001,111,0002,117,632
8Aug 14, 2026 14:484,50257,851,13348,500,0001,023,0002,117,632
9Aug 14, 2026 14:484,50457,826,48148,532,0001,022,0002,117,632
10Aug 14, 2026 14:484,51359,203,60348,607,0001,039,0002,117,632
11Aug 14, 2026 14:484,51758,121,49848,646,0001,045,0002,117,632
12Aug 14, 2026 14:484,51958,046,89448,572,0001,142,0002,117,632