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 18, 2026 00:22Josu San MartinJosu San MartinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 03:34C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 03:35016,744,3198,420,00002,113,536expected "2 ", got "65522"
2Sep 8, 2026 03:35016,720,5268,446,00002,113,536expected "2 ", got "65522"
3Sep 8, 2026 03:35016,590,6448,330,00002,113,536expected "2 ", got "65522"
4Aug 18, 2026 00:292,84539,471,30131,297,00002,113,536
5Aug 18, 2026 00:292,84740,849,84531,321,00002,113,536
6Aug 18, 2026 00:292,84739,560,94531,323,00002,113,536
7Aug 18, 2026 00:292,85641,059,66930,322,0001,097,0002,113,536
8Aug 18, 2026 00:292,85639,588,62531,419,00002,113,536
9Aug 18, 2026 00:292,85939,686,50931,451,00002,113,536
10Aug 18, 2026 00:292,85941,598,97730,443,0001,009,0002,113,536
11Aug 18, 2026 00:292,86239,528,93730,464,0001,026,0002,113,536
12Aug 18, 2026 00:292,86539,690,11131,523,00002,113,536