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:44marko1597marko1597Error
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 9, 2026 09:33C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 9, 2026 09:33019,167,3488,000,0001,133,0002,117,632expected "2 ", got "75614208 "
2Sep 9, 2026 09:33019,096,4737,986,0001,134,0002,117,632expected "2 ", got "75614208 "
3Sep 9, 2026 09:33019,087,1697,989,0001,145,0002,117,632expected "2 ", got "75614208 "
4Aug 14, 2026 13:444,50359,368,40248,438,0001,100,0002,113,536
5Aug 14, 2026 13:444,50559,452,35448,460,0001,096,0002,113,536
6Aug 14, 2026 13:444,50659,377,44348,484,0001,088,0002,113,536
7Aug 14, 2026 13:444,51059,389,97648,506,0001,110,0002,113,536
8Aug 14, 2026 13:444,51269,725,25748,616,0001,023,0002,113,536
9Aug 14, 2026 13:444,51459,568,33748,556,0001,107,0002,113,536
10Aug 14, 2026 13:444,52559,664,96148,685,0001,097,0002,113,536
11Aug 14, 2026 13:444,52659,654,79348,713,0001,082,0002,113,536
12Aug 14, 2026 13:444,53359,722,52048,766,0001,106,0002,113,536