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 listMar 27, 2026 07:51olliecrowolliecrowScore: 3,152Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 27, 2026 07:513,13356,553,33734,463,00002,277,376
2Mar 27, 2026 07:513,13659,384,02833,480,0001,014,0002,400,256
3Mar 27, 2026 07:513,14057,780,44833,527,0001,015,0002,277,376
4Mar 27, 2026 07:513,14256,292,14033,543,0001,016,0002,510,848
5Mar 27, 2026 07:513,14263,555,70434,562,00002,277,376
6Mar 27, 2026 07:513,14360,673,65134,575,00002,400,256
7Mar 27, 2026 07:513,14759,964,45833,596,0001,018,0002,277,376
8Mar 27, 2026 07:513,14766,815,98033,602,0001,018,0002,277,376
9Mar 27, 2026 07:513,15060,719,39333,633,0001,019,0002,400,256
10Mar 27, 2026 07:513,15166,144,07433,638,0001,019,0002,277,376
11Mar 27, 2026 07:513,15163,937,33933,646,0001,019,0002,277,376
12Mar 27, 2026 07:513,15160,543,34433,638,0001,019,0002,277,376
13Mar 27, 2026 07:513,15257,336,25934,669,00002,277,376
14Mar 27, 2026 07:513,15260,118,26933,651,0001,019,0002,277,376
15Mar 27, 2026 07:513,15361,854,71933,663,0001,020,0002,277,376
16Mar 27, 2026 07:513,15559,986,26033,684,0001,020,0002,392,064
17Mar 27, 2026 07:513,16657,370,06733,835,000995,0002,404,352
18Mar 27, 2026 07:513,16760,282,33333,847,000995,0002,277,376
19Mar 27, 2026 07:513,16965,766,72932,868,0001,992,0002,277,376
20Mar 27, 2026 07:513,16959,817,85533,860,000995,0002,400,256
21Mar 27, 2026 07:513,17165,660,69432,890,0001,993,0002,277,376
22Mar 27, 2026 07:513,17261,296,49433,863,0001,026,0002,277,376
23Mar 27, 2026 07:513,17561,472,50133,929,000997,0002,400,256
24Mar 27, 2026 07:513,18361,088,05833,012,0002,000,0002,392,064