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 listJan 1, 2026 08:22kairveekairveeScore: 494,890Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 1, 2026 08:24490,3625,422,867,6185,355,003,00038,978,0002,281,472
2Jan 1, 2026 08:22492,8375,446,984,1485,378,243,00042,969,0002,519,040
3Jan 1, 2026 08:24493,8075,461,826,4375,412,888,00018,985,0002,281,472
4Jan 1, 2026 08:22494,8905,470,275,7775,407,808,00035,978,0002,289,664
5Jan 1, 2026 08:24495,1895,473,968,2835,399,107,00047,974,0002,281,472
6Jan 1, 2026 08:22495,4005,475,905,2525,410,420,00038,981,0002,289,664