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 01:49olliecrowolliecrowScore: 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 01:493,13757,133,76434,510,00002,277,376
2Mar 27, 2026 01:493,13854,512,38533,501,0001,015,0002,277,376
3Mar 27, 2026 01:493,13861,119,49634,523,00002,396,160
4Mar 27, 2026 01:493,13955,825,09433,516,0001,015,0002,392,064
5Mar 27, 2026 01:493,13956,385,12534,527,00002,404,352
6Mar 27, 2026 01:493,13954,718,38533,509,0001,015,0002,404,352
7Mar 27, 2026 01:493,14057,267,60534,544,00002,277,376
8Apr 16, 2026 03:023,14055,187,79233,525,0001,015,0002,387,968
9Mar 27, 2026 01:493,14261,302,85933,549,0001,016,0002,277,376
10Mar 27, 2026 01:493,14257,099,14133,543,0001,016,0002,277,376
11Mar 27, 2026 01:493,14257,564,36334,562,00002,277,376
12Mar 27, 2026 01:493,14457,231,21933,568,0001,017,0002,277,376
13Mar 27, 2026 01:493,14558,991,16533,581,0001,017,0002,277,376
14Mar 27, 2026 01:493,14566,113,25334,590,00002,277,376
15Mar 27, 2026 01:493,14760,617,33734,616,00002,404,352
16Mar 27, 2026 01:493,14761,791,78334,619,00002,514,944
17Mar 27, 2026 01:493,14860,557,65433,609,0001,018,0002,396,160
18Mar 27, 2026 01:493,14864,794,23934,624,00002,404,352
19Mar 27, 2026 01:493,14962,060,87434,643,00002,277,376
20Mar 27, 2026 01:493,15061,062,23534,649,00002,277,376
21Apr 16, 2026 03:023,15463,711,01534,697,00002,396,160
22Mar 27, 2026 01:493,15464,934,97133,670,0001,020,0002,277,376
23Mar 27, 2026 01:493,16457,819,92632,818,0001,988,0002,400,256
24Mar 27, 2026 01:493,16763,312,05933,845,000995,0002,277,376
25Mar 27, 2026 01:493,16760,013,36932,850,0001,990,0002,396,160
26Mar 27, 2026 01:493,16867,098,62833,855,000995,0002,277,376
27Mar 27, 2026 01:493,16957,675,09133,862,000995,0002,396,160
28Mar 27, 2026 01:493,16959,396,23333,863,000995,0002,277,376
29Mar 27, 2026 01:493,16962,269,32034,861,00002,277,376
30Mar 27, 2026 01:493,17059,640,70733,869,000996,0002,404,352
31Mar 27, 2026 01:493,17355,272,93733,910,000997,0002,277,376
32Apr 16, 2026 03:023,18059,692,36432,981,0001,998,0002,277,376
33Mar 27, 2026 01:493,24192,352,67134,636,0001,018,0002,273,280