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 listDec 30, 2025 06:56kairveekairveeScore: 608,727Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 30, 2025 06:56606,0646,697,203,9556,628,722,00037,981,0002,277,376
2Dec 30, 2025 06:56606,6396,703,479,3246,645,039,00027,987,0002,277,376
3Dec 30, 2025 06:56608,5486,721,290,5966,668,044,00025,988,0002,543,616
4Dec 30, 2025 06:56608,5506,717,842,8726,660,065,00033,985,0002,277,376
5Dec 30, 2025 06:56608,7276,729,628,8476,663,015,00032,985,0002,277,376
6Dec 30, 2025 06:56616,2446,806,429,6506,736,710,00041,973,0002,285,568
7Dec 30, 2025 06:56619,2356,843,492,5166,775,610,00035,976,0002,277,376
8Dec 30, 2025 06:56630,7586,966,087,3476,908,358,00029,984,0002,277,376
9Dec 30, 2025 06:56693,4687,653,646,1257,594,169,00033,982,0002,277,376