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:40olliecrowolliecrowScore: 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:403,13557,263,32533,476,0001,014,0002,404,352
2Mar 27, 2026 02:403,13857,330,75634,518,00002,277,376
3Mar 27, 2026 02:403,14155,825,11933,534,0001,016,0002,404,352
4Mar 27, 2026 02:403,14258,516,50934,560,00002,277,376
5Mar 27, 2026 02:403,14363,274,85433,556,0001,016,0002,277,376
6Mar 27, 2026 02:403,14460,824,50633,569,0001,017,0002,396,160
7Mar 27, 2026 02:403,14761,558,51933,602,0001,018,0002,502,656
8Mar 27, 2026 02:403,14865,210,41633,605,0001,018,0002,277,376
9Mar 27, 2026 02:403,14860,564,52734,627,00002,387,968
10Mar 27, 2026 02:403,14864,603,93133,609,0001,018,0002,482,176
11Mar 27, 2026 02:403,14964,112,85334,644,00002,400,256
12Mar 27, 2026 02:403,14966,991,21434,635,00002,396,160
13Mar 27, 2026 02:403,15066,724,68933,633,0001,019,0002,277,376
14Mar 27, 2026 02:403,15161,148,70234,665,00002,396,160
15Mar 27, 2026 02:403,15465,173,48133,678,0001,020,0002,277,376
16Mar 27, 2026 02:403,15559,049,19933,689,0001,020,0002,277,376
17Mar 27, 2026 02:403,16763,876,24632,848,0001,990,0002,396,160
18Mar 27, 2026 02:403,16862,753,89933,855,000995,0002,277,376
19Mar 27, 2026 02:403,16861,616,44133,851,000995,0002,277,376
20Mar 27, 2026 02:403,16863,806,42833,853,000995,0002,277,376
21Mar 27, 2026 02:403,16861,792,06433,857,000995,0002,400,256
22Mar 27, 2026 02:403,17062,030,84533,876,000996,0002,277,376
23Mar 27, 2026 02:403,17263,000,54432,902,0001,994,0002,277,376
24Mar 27, 2026 02:403,20258,219,37633,212,0002,012,0002,400,256