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:02olliecrowolliecrowScore: 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 04:023,13957,889,74333,515,0001,015,0002,277,376
2Mar 27, 2026 04:023,13955,355,93833,510,0001,015,0002,392,064
3Mar 27, 2026 04:023,14355,637,24933,553,0001,016,0002,396,160
4Mar 27, 2026 04:023,14458,484,12433,562,0001,017,0002,277,376
5Mar 27, 2026 04:023,14468,622,06134,587,00002,277,376
6Mar 27, 2026 04:023,14666,468,88633,585,0001,017,0002,519,040
7Mar 27, 2026 04:023,14763,979,60334,620,00002,277,376
8Mar 27, 2026 04:023,14765,124,54533,597,0001,018,0002,400,256
9Mar 27, 2026 04:023,14865,187,10733,607,0001,018,0002,277,376
10Mar 27, 2026 04:023,14867,223,69934,632,00002,277,376
11Mar 27, 2026 04:023,14863,137,99334,631,00002,277,376
12Mar 27, 2026 04:023,14961,899,17534,636,00002,277,376
13Mar 27, 2026 04:023,14961,603,35433,624,0001,018,0002,396,160
14Mar 27, 2026 04:023,15259,498,62534,668,00002,400,256
15Mar 27, 2026 04:023,15263,712,32033,650,0001,019,0002,277,376
16Mar 27, 2026 04:023,15360,463,19033,661,0001,020,0002,494,464
17Mar 27, 2026 04:023,15361,755,67634,681,00002,277,376
18Mar 27, 2026 04:023,15460,275,53633,679,0001,020,0002,494,464
19Mar 27, 2026 04:023,16661,730,20833,828,000994,0002,392,064
20Mar 27, 2026 04:023,16658,704,36732,835,0001,990,0002,400,256
21Mar 27, 2026 04:023,16860,853,43032,862,0001,991,0002,404,352
22Mar 27, 2026 04:023,16963,729,89032,868,0001,992,0002,400,256
23Mar 27, 2026 04:023,16962,854,53634,859,00002,277,376
24Mar 27, 2026 04:023,17361,273,04633,909,000997,0002,400,256