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 listFeb 14, 2026 04:19olliecrowolliecrowScore: 3,559Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 14, 2026 04:333,55163,345,89438,060,0001,001,0002,277,376
2Feb 14, 2026 04:333,55171,281,04537,062,0002,003,0002,392,064
3Feb 14, 2026 04:333,55265,725,73337,070,0002,003,0002,396,160
4Feb 14, 2026 04:333,55362,000,26638,080,0001,002,0002,412,544
5Feb 14, 2026 04:333,55361,991,72138,082,0001,002,0002,277,376
6Feb 14, 2026 04:333,55666,792,21637,110,0002,005,0002,277,376
7Feb 14, 2026 04:333,55965,718,08938,150,0001,003,0002,277,376
8Feb 14, 2026 04:193,56067,700,30138,160,0001,004,0002,277,376
9Feb 14, 2026 04:333,56061,878,74038,154,0001,004,0002,277,376
10Feb 14, 2026 04:333,56165,304,47237,162,0002,008,0002,277,376
11Feb 14, 2026 04:193,58760,775,65038,441,0001,011,0002,277,376
12Feb 14, 2026 04:193,58962,036,11038,472,0001,012,0002,277,376