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 14, 2026 13:18marko1597marko1597Error
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 9, 2026 09:34C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 9, 2026 09:35019,202,6087,999,0001,151,0002,117,632expected "2 ", got "75614208 "
2Sep 9, 2026 09:35019,192,2347,953,0001,120,0002,117,632expected "2 ", got "75614208 "
3Sep 9, 2026 09:35019,182,0788,005,0001,150,0002,117,632expected "2 ", got "75614208 "
4Aug 14, 2026 13:194,52759,631,32548,781,0001,016,0002,113,536
5Aug 14, 2026 13:194,52859,678,31748,744,0001,073,0002,113,536
6Aug 14, 2026 13:194,53759,760,40548,834,0001,082,0002,113,536
7Aug 14, 2026 13:194,54059,791,63848,845,0001,096,0002,113,536
8Aug 14, 2026 13:194,54259,831,58548,874,0001,089,0002,113,536
9Aug 14, 2026 13:194,54659,862,16648,990,0001,016,0002,113,536
10Aug 14, 2026 13:194,54959,846,09349,007,0001,034,0002,113,536
11Aug 14, 2026 13:194,55559,974,38548,953,0001,152,0002,113,536
12Aug 14, 2026 13:194,56059,984,95548,926,0001,242,0002,113,536