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 2, 2025 05:14Yuriy LyfenkoYuriy LyfenkoError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 04:03C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 04:04010,487,195784,000020,480No answer to stdout. Died or killed?
2Sep 2, 2025 05:073,86770,294,61141,529,0001,012,0002,260,992
3Sep 2, 2025 05:143,87368,625,14041,588,0001,014,0002,260,992
4Sep 2, 2025 05:073,88370,444,48741,695,0001,016,0002,260,992
5Nov 19, 2025 17:543,89069,832,67140,803,0001,990,0002,387,968
6Nov 19, 2025 17:543,89465,846,49841,833,000996,0002,383,872
7Sep 2, 2025 05:143,89568,801,21741,851,000996,0002,519,040
8Sep 2, 2025 05:143,90270,168,00940,929,0001,996,0002,396,160
9Nov 19, 2025 17:543,90673,081,19240,965,0001,998,0002,396,160
10Sep 2, 2025 05:073,90872,075,18241,988,000999,0002,519,040