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 16, 2026 07:31marko1597marko1597Error
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 17:26C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 17:29016,244,4146,635,0001,115,0002,117,632expected "2 ", got "58 "
2Sep 8, 2026 17:29016,338,4716,657,0001,122,0002,117,632expected "2 ", got "58 "
3Sep 8, 2026 17:29016,176,3336,644,0001,066,0002,117,632expected "2 ", got "58 "
4Aug 16, 2026 07:503,45646,682,64236,918,0001,107,0002,117,632
5Aug 16, 2026 07:503,46046,601,64136,975,0001,094,0002,117,632
6Aug 16, 2026 07:503,46146,445,49537,048,0001,030,0002,117,632
7Aug 16, 2026 07:503,46346,525,15537,056,0001,045,0002,117,632
8Aug 16, 2026 07:503,46446,494,27537,010,0001,097,0002,117,632
9Aug 16, 2026 07:503,46546,544,04637,029,0001,091,0002,117,632
10Aug 16, 2026 07:503,47046,506,91737,088,0001,085,0002,117,632
11Aug 16, 2026 07:503,48446,717,47637,234,0001,099,0002,117,632
12Aug 16, 2026 07:503,54147,318,77337,914,0001,040,0002,117,632