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 02:33olliecrowolliecrowScore: 3,150Success
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 02:333,13758,088,22233,494,0001,014,0002,404,352
2Mar 27, 2026 02:333,13860,937,20633,498,0001,015,0002,277,376
3Mar 27, 2026 02:333,14158,533,10334,551,00002,277,376
4Mar 27, 2026 02:333,14361,562,51133,559,0001,016,0002,277,376
5Mar 27, 2026 02:333,14366,705,81933,559,0001,016,0002,277,376
6Mar 27, 2026 02:333,14662,174,43934,610,00002,277,376
7Mar 27, 2026 02:333,14763,018,77334,619,00002,277,376
8Mar 27, 2026 02:333,14764,083,25734,612,00002,396,160
9Mar 27, 2026 02:333,14969,097,70134,636,00002,392,064
10Mar 27, 2026 02:333,14960,644,73434,636,00002,277,376
11Mar 27, 2026 02:333,14961,397,59733,622,0001,018,0002,277,376
12Mar 27, 2026 02:333,14958,554,30734,636,00002,400,256
13Mar 27, 2026 02:333,15060,299,68134,652,00002,392,064
14Mar 27, 2026 02:333,15165,803,19034,659,00002,408,448
15Mar 27, 2026 02:333,15161,273,45134,662,00002,400,256
16Mar 27, 2026 02:333,15161,025,02233,640,0001,019,0002,277,376
17Mar 27, 2026 02:333,15262,996,46933,649,0001,019,0002,396,160
18Mar 27, 2026 02:333,15365,572,61434,688,00002,396,160
19Mar 27, 2026 02:333,16868,730,16932,855,0001,991,0002,277,376
20Mar 27, 2026 02:333,17059,330,75133,879,000996,0002,404,352
21Mar 27, 2026 02:333,17065,821,78932,874,0001,992,0002,277,376
22Mar 27, 2026 02:333,17261,154,48732,901,0001,994,0002,392,064
23Mar 27, 2026 02:333,17358,395,67333,906,000997,0002,404,352
24Mar 27, 2026 02:333,17659,956,83332,939,0001,996,0002,277,376