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:58Josu San MartinJosu San MartinError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 03:47C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 03:48019,591,5168,591,0001,076,0002,179,072expected "2 ", got "65522"
2Sep 8, 2026 03:48019,465,6088,573,0001,083,0002,134,016expected "2 ", got "65522"
3Sep 8, 2026 03:48019,533,2588,567,0001,080,0002,129,920expected "2 ", got "65522"
4Aug 18, 2026 01:032,95542,283,08631,456,0001,059,0002,174,976
5Aug 18, 2026 01:032,95642,691,23531,464,0001,056,0002,129,920
6Aug 18, 2026 01:032,96042,418,68531,495,0001,071,0002,174,976
7Aug 18, 2026 01:032,96342,727,53231,536,0001,064,0002,174,976
8Aug 18, 2026 01:032,96342,235,06831,533,0001,066,0002,129,920
9Aug 18, 2026 01:032,96742,421,05831,567,0001,078,0002,129,920
10Aug 18, 2026 01:032,96942,486,74931,590,0001,079,0002,129,920
11Aug 18, 2026 01:032,97142,396,43231,609,0001,082,0002,129,920
12Aug 18, 2026 01:032,98342,562,74431,732,0001,083,0002,129,920