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 21, 2026 15:44Andrew EpsteinAndrew EpsteinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 03:09C#_user21.83CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 03:09018,626,2097,624,0001,038,0002,117,632expected "2 ", got "0 "
2Sep 8, 2026 03:09018,583,5527,668,0001,046,0002,117,632expected "2 ", got "0 "
3Sep 8, 2026 03:09018,576,0037,590,0001,040,0002,117,632expected "2 ", got "0 "
4Aug 21, 2026 15:443,65250,847,61339,157,0001,020,0002,113,536
5Aug 21, 2026 15:443,65450,025,74439,120,0001,082,0002,113,536
6Aug 21, 2026 15:443,65449,917,63139,174,0001,021,0002,113,536
7Aug 21, 2026 15:443,65950,105,17439,221,0001,038,0002,113,536
8Aug 21, 2026 15:443,66150,723,71139,176,0001,101,0002,113,536
9Aug 21, 2026 15:443,66350,724,36039,206,0001,092,0002,113,536
10Aug 21, 2026 15:443,66550,835,24039,214,0001,104,0002,113,536
11Aug 21, 2026 15:443,66650,860,33339,234,0001,096,0002,113,536
12Aug 21, 2026 15:443,67450,201,74639,316,0001,100,0002,113,536