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 06:39olliecrowolliecrowScore: 3,149Success
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 06:393,13754,700,94933,489,0001,014,0002,392,064
2Mar 27, 2026 06:393,13956,036,70333,510,0001,015,0002,400,256
3Mar 27, 2026 06:393,14157,856,51833,537,0001,016,0002,400,256
4Mar 27, 2026 06:393,14160,140,13733,534,0001,016,0002,277,376
5Mar 27, 2026 06:393,14262,236,26534,562,00002,277,376
6Mar 27, 2026 06:393,14255,243,00833,550,0001,016,0002,277,376
7Mar 27, 2026 06:393,14358,643,50233,560,0001,016,0002,277,376
8Mar 27, 2026 06:393,14457,096,77134,584,00002,412,544
9Mar 27, 2026 06:393,14860,467,46134,631,00002,277,376
10Mar 27, 2026 06:393,14865,407,88933,608,0001,018,0002,277,376
11Mar 27, 2026 06:393,14863,801,14933,610,0001,018,0002,277,376
12Mar 27, 2026 06:393,14960,936,92033,620,0001,018,0002,400,256
13Mar 27, 2026 06:393,14963,540,54734,639,00002,404,352
14Mar 27, 2026 06:393,14966,646,73534,636,00002,277,376
15Mar 27, 2026 06:393,15066,481,37134,646,00002,277,376
16Mar 27, 2026 06:393,15065,009,64834,645,00002,277,376
17Mar 27, 2026 06:393,15062,048,98433,628,0001,019,0002,404,352
18Mar 27, 2026 06:393,15163,543,47833,640,0001,019,0002,277,376
19Mar 27, 2026 06:393,15162,893,93033,637,0001,019,0002,400,256
20Mar 27, 2026 06:393,15163,524,06434,661,00002,392,064
21Mar 27, 2026 06:393,15263,143,42534,677,00002,277,376
22Mar 27, 2026 06:393,15464,750,37234,696,00002,277,376
23Mar 27, 2026 06:393,16563,136,33232,824,0001,989,0002,277,376
24Mar 27, 2026 06:393,16762,936,66832,851,0001,991,0002,277,376