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

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 04:59C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 05:00018,550,6188,563,00002,117,632expected "2 ", got "0 "
2Sep 8, 2026 05:00018,541,2468,659,00002,117,632expected "2 ", got "0 "
3Sep 8, 2026 05:00018,619,8967,674,0001,022,0002,117,632expected "2 ", got "0 "
4Mar 27, 2026 04:023,13957,889,74333,515,0001,015,0002,277,376
5Mar 27, 2026 04:023,13955,355,93833,510,0001,015,0002,392,064
6Mar 27, 2026 04:023,14355,637,24933,553,0001,016,0002,396,160
7Mar 27, 2026 04:023,14458,484,12433,562,0001,017,0002,277,376
8Mar 27, 2026 04:023,14468,622,06134,587,00002,277,376
9Mar 27, 2026 04:023,14666,468,88633,585,0001,017,0002,519,040
10Mar 27, 2026 04:023,14763,979,60334,620,00002,277,376
11Mar 27, 2026 04:023,14765,124,54533,597,0001,018,0002,400,256
12Mar 27, 2026 04:023,14865,187,10733,607,0001,018,0002,277,376
13Mar 27, 2026 04:023,14863,137,99334,631,00002,277,376
14Mar 27, 2026 04:023,14867,223,69934,632,00002,277,376
15Mar 27, 2026 04:023,14961,899,17534,636,00002,277,376
16Mar 27, 2026 04:023,14961,603,35433,624,0001,018,0002,396,160
17Mar 27, 2026 04:023,15259,498,62534,668,00002,400,256
18Mar 27, 2026 04:023,15263,712,32033,650,0001,019,0002,277,376
19Mar 27, 2026 04:023,15361,755,67634,681,00002,277,376
20Mar 27, 2026 04:023,15360,463,19033,661,0001,020,0002,494,464
21Mar 27, 2026 04:023,15460,275,53633,679,0001,020,0002,494,464
22Mar 27, 2026 04:023,16661,730,20833,828,000994,0002,392,064
23Mar 27, 2026 04:023,16658,704,36732,835,0001,990,0002,400,256
24Mar 27, 2026 04:023,16860,853,43032,862,0001,991,0002,404,352
25Mar 27, 2026 04:023,16963,729,89032,868,0001,992,0002,400,256
26Mar 27, 2026 04:023,16962,854,53634,859,00002,277,376
27Mar 27, 2026 04:023,17361,273,04633,909,000997,0002,400,256