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 17, 2026 13:12Tomislav TunkovicTomislav TunkovicError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 7, 2026 17:47C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 7, 2026 17:47022,110,24710,155,0002,076,00036,864No answer to stdout. Died or killed?
2Aug 17, 2026 13:312,27035,041,05022,824,0002,147,00028,672
3Aug 17, 2026 13:312,28236,266,89723,069,0002,040,00028,672
4Aug 17, 2026 13:312,28847,120,66823,083,0002,092,00028,672
5Aug 17, 2026 13:312,28834,854,46823,087,0002,082,00028,672
6Aug 17, 2026 13:312,29535,267,73023,214,0002,039,00028,672
7Aug 17, 2026 13:312,29735,001,57923,231,0002,042,00032,768
8Aug 17, 2026 13:312,31935,317,51223,466,0002,043,00032,768
9Aug 17, 2026 13:312,32235,601,84223,472,0002,072,00032,768
10Aug 17, 2026 13:312,33835,482,42223,655,0002,067,00032,768