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 listJun 20, 2026 19:11A_ShamanA_ShamanScore: 34,851Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 20, 2026 19:1134,614390,447,003257,121,000123,642,0002,117,632
2Jun 20, 2026 19:1134,824392,553,159258,940,000124,132,0002,117,632
3Jun 20, 2026 19:1134,826392,718,880258,479,000124,616,0002,117,632
4Jun 20, 2026 19:1134,832392,812,893257,780,000125,380,0002,117,632
5Jun 20, 2026 19:1134,851392,733,574258,000,000125,366,0002,117,632
6Jun 20, 2026 19:1134,864392,882,240257,403,000126,106,0002,113,536
7Jun 20, 2026 19:1134,893393,149,633257,333,000126,493,0002,117,632
8Jun 20, 2026 19:1135,022396,268,409257,297,000127,948,0002,117,632
9Jun 20, 2026 19:1135,365398,392,590263,718,000125,301,0002,117,632