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:02olliecrowolliecrowScore: 3,148Success
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:023,13563,908,77834,484,00002,277,376
2Mar 27, 2026 07:023,13855,435,65634,523,00002,277,376
3Mar 27, 2026 07:023,13858,166,54133,498,0001,015,0002,277,376
4Mar 27, 2026 07:023,13955,543,78634,529,00002,392,064
5Mar 27, 2026 07:023,14157,512,38432,579,0001,974,0002,277,376
6Mar 27, 2026 07:023,14256,946,03634,559,00002,277,376
7Mar 27, 2026 07:023,14357,464,74733,558,0001,016,0002,396,160
8Mar 27, 2026 07:023,14561,785,66233,576,0001,017,0002,277,376
9Mar 27, 2026 07:023,14664,137,38834,601,00002,277,376
10Mar 27, 2026 07:023,14661,523,02034,611,00002,277,376
11Mar 27, 2026 07:023,14763,598,27533,594,0001,018,0002,404,352
12Mar 27, 2026 07:023,14859,813,34534,632,00002,400,256
13Mar 27, 2026 07:023,14862,180,71133,608,0001,018,0002,396,160
14Mar 27, 2026 07:023,14960,504,29633,617,0001,018,0002,277,376
15Mar 27, 2026 07:023,15462,962,52333,675,0001,020,0002,277,376
16Mar 27, 2026 07:023,15565,927,98034,702,00002,404,352
17Mar 27, 2026 07:023,15561,186,95533,681,0001,020,0002,396,160
18Mar 27, 2026 07:023,15666,687,04833,693,0001,021,0002,498,560
19Mar 27, 2026 07:023,16960,217,66833,868,000996,0002,277,376
20Mar 27, 2026 07:023,16955,647,23433,860,000995,0002,277,376
21Mar 27, 2026 07:023,16968,530,39432,866,0001,991,0002,277,376
22Mar 27, 2026 07:023,17160,150,83733,884,000996,0002,519,040
23Mar 27, 2026 07:023,17559,061,35733,930,000997,0002,277,376
24Mar 27, 2026 07:023,17756,548,82832,953,0001,997,0002,277,376