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 15, 2026 09:34Tomislav TunkovicTomislav TunkovicError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 03:20C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 03:20016,519,7477,889,000020,480No answer to stdout. Died or killed?
2Aug 15, 2026 09:3538,949437,017,961427,274,0001,165,0002,121,728stderr
3Aug 15, 2026 09:3538,987437,373,005427,764,0001,098,0002,121,728stderr
4Aug 15, 2026 09:3539,014437,674,084428,153,0001,002,0002,121,728stderr
5Aug 15, 2026 09:3539,060438,853,294428,641,0001,021,0002,121,728stderr
6Aug 15, 2026 09:3539,079438,953,278428,782,0001,091,0002,121,728stderr
7Aug 15, 2026 09:3539,149439,064,269429,514,0001,129,0002,121,728stderr
8Aug 15, 2026 09:3539,178439,411,927429,843,0001,117,0002,121,728stderr
9Aug 15, 2026 09:3539,189439,571,535429,989,0001,093,0002,121,728stderr
10Aug 15, 2026 09:3539,880447,199,145437,600,0001,089,0002,121,728stderr