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 listSep 1, 2025 15:07Alex KentAlex KentError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 7, 2026 16:58C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 7, 2026 16:58011,939,5051,408,000020,480No answer to stdout. Died or killed?
2Sep 1, 2025 15:0714,710190,031,421161,810,00002,285,568
3Sep 1, 2025 15:0714,711193,620,820159,824,0001,997,0002,285,568
4Sep 1, 2025 15:0714,757184,815,306161,323,0001,002,0002,519,040
5Sep 1, 2025 15:0714,768183,576,161162,448,00002,519,040
6Sep 1, 2025 15:0714,777188,600,761161,543,0001,003,0002,285,568
7Sep 1, 2025 15:0714,800188,492,097160,799,0001,997,0002,260,992
8Sep 1, 2025 15:0714,830187,234,717161,127,0002,001,0002,285,568
9Sep 1, 2025 15:0714,843185,577,082161,265,0002,003,0002,265,088
10Sep 1, 2025 15:0714,890190,029,802161,790,0001,997,0002,285,568