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 listNov 26, 2026 16:37LeighAtkinsLeighAtkinsScore: 26,430Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 26, 2026 16:4826,371300,494,232288,074,0002,009,0002,138,112
2Nov 26, 2026 16:4826,392300,325,621288,275,0002,043,0002,138,112
3Nov 26, 2026 16:4826,425300,830,626288,643,0002,034,0002,138,112
4Nov 26, 2026 16:4826,426301,072,161289,677,0001,014,0002,138,112
5Nov 26, 2026 16:4826,430300,937,871288,675,0002,059,0002,138,112
6Nov 26, 2026 16:4826,437298,663,242289,802,0001,005,0002,138,112
7Nov 26, 2026 16:4826,452298,705,601289,966,0001,006,0002,138,112
8Nov 26, 2026 16:4826,454301,102,129288,963,0002,037,0002,138,112
9Nov 26, 2026 16:4826,518303,112,730290,698,0001,006,0002,138,112