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:49olliecrowolliecrowError
Source Code

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

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