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 26, 2025 15:47Wookyung JeongWookyung JeongScore: 75,674Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 26, 2025 15:4775,529859,655,364757,835,00072,984,0002,265,088
2Sep 26, 2025 15:4775,545854,685,936771,991,00058,999,0002,371,584
3Sep 26, 2025 15:4775,581863,646,483758,445,00072,946,0002,269,184
4Sep 26, 2025 15:4775,634855,703,772759,978,00071,997,0002,519,040
5Sep 26, 2025 15:4775,674868,050,206762,467,00069,951,0002,420,736
6Sep 26, 2025 15:4775,744864,076,958781,171,00052,011,0002,342,912
7Sep 26, 2025 15:4775,769861,253,875765,506,00067,956,0002,326,528
8Sep 26, 2025 15:4775,798858,177,582764,796,00068,981,0002,482,176
9Sep 26, 2025 15:4775,860859,165,870767,505,00066,956,0002,392,064