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

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 03:43C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 03:43018,616,5747,627,0001,011,0002,117,632expected "2 ", got "65522"
2Sep 8, 2026 03:43019,190,4047,660,0001,011,0002,117,632expected "2 ", got "65522"
3Sep 8, 2026 03:43019,071,5307,665,0001,017,0002,117,632expected "2 ", got "65522"
4Aug 18, 2026 00:242,87951,735,71030,575,0001,095,0002,113,536
5Aug 18, 2026 00:242,88451,603,81330,646,0001,078,0002,113,536
6Aug 18, 2026 00:242,89788,543,37830,814,0001,062,0002,113,536
7Aug 18, 2026 00:242,90080,728,10430,887,0001,022,0002,113,536
8Aug 18, 2026 00:242,90071,885,14330,831,0001,071,0002,113,536
9Aug 18, 2026 00:242,90651,265,99130,835,0001,139,0002,113,536
10Aug 18, 2026 00:242,90666,478,59130,890,0001,076,0002,113,536
11Aug 18, 2026 00:242,91071,913,60830,928,0001,087,0002,113,536
12Aug 18, 2026 00:242,915133,027,13530,998,0001,073,0002,113,536