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 17:50Tomislav TunkovicTomislav TunkovicError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 7, 2026 17:42C#_user22.88CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 7, 2026 17:42019,124,4997,806,0001,111,00020,480No answer to stdout. Died or killed?
2Aug 17, 2026 18:242,00236,066,09120,928,0001,100,00024,576
3Aug 17, 2026 18:242,00331,932,76320,937,0001,103,00024,576
4Aug 17, 2026 18:242,00430,327,96320,931,0001,118,00024,576
5Aug 17, 2026 18:242,00931,873,76221,008,0001,097,00024,576
6Aug 17, 2026 18:242,01130,525,61221,039,0001,086,00024,576
7Aug 17, 2026 18:242,02030,679,00421,093,0001,129,00024,576
8Aug 17, 2026 18:242,02130,685,46321,190,0001,042,00024,576
9Aug 17, 2026 18:242,03030,686,63121,243,0001,095,00024,576
10Aug 17, 2026 18:242,03130,759,05421,323,0001,028,00024,576