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 00:24Josu San MartinJosu San MartinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 03:50C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 03:51021,453,4578,258,0001,349,0002,142,208expected "2 ", got "65522"
2Sep 8, 2026 03:51020,375,1328,262,0001,385,0002,138,112expected "2 ", got "65522"
3Sep 8, 2026 03:51020,300,1078,432,0001,264,0002,142,208expected "2 ", got "65522"
4Aug 18, 2026 00:312,96240,945,60231,560,0001,023,0002,138,112
5Aug 18, 2026 00:312,96541,057,62231,599,0001,024,0002,138,112
6Aug 18, 2026 00:312,96541,087,29631,595,0001,024,0002,138,112
7Aug 18, 2026 00:312,96741,126,42431,607,0001,030,0002,138,112
8Aug 18, 2026 00:312,96842,305,71931,626,0001,025,0002,138,112
9Aug 18, 2026 00:312,96941,169,73231,633,0001,028,0002,138,112
10Aug 18, 2026 00:312,96941,087,07931,638,0001,027,0002,138,112
11Aug 18, 2026 00:312,97041,109,42331,638,0001,036,0002,138,112
12Aug 18, 2026 00:312,97541,114,17131,710,0001,025,0002,138,112