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 27, 2025 07:49Wookyung JeongWookyung JeongScore: 30,907Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 27, 2025 07:4930,845369,761,485317,276,00022,019,0002,408,448
2Sep 27, 2025 07:4930,868373,891,824313,585,00025,965,0002,293,760
3Sep 27, 2025 07:4930,880368,017,993319,704,00019,981,0002,367,488
4Sep 27, 2025 07:4830,882373,632,336319,720,00019,982,0002,371,584
5Sep 27, 2025 07:4830,907369,655,082324,979,00014,999,0002,326,528
6Sep 27, 2025 07:4930,923360,978,226316,143,00024,010,0002,396,160
7Sep 27, 2025 07:4930,930365,247,712317,214,00023,015,0002,396,160
8Sep 27, 2025 07:4830,965366,257,595324,637,00015,982,0002,437,120
9Sep 27, 2025 07:4930,969361,670,918317,679,00022,976,0002,326,528