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 03:57olliecrowolliecrowScore: 3,151Success
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 03:573,13857,286,24334,518,00002,277,376
2Mar 27, 2026 03:573,13960,512,27134,524,00002,383,872
3Mar 27, 2026 03:573,13961,054,74233,518,0001,015,0002,277,376
4Mar 27, 2026 03:573,14258,593,27233,544,0001,016,0002,277,376
5Mar 27, 2026 03:573,14260,412,09634,566,00002,400,256
6Mar 27, 2026 03:573,14259,788,37533,551,0001,016,0002,277,376
7Mar 27, 2026 03:573,14261,636,50133,541,0001,016,0002,400,256
8Mar 27, 2026 03:573,14364,416,61334,577,00002,277,376
9Mar 27, 2026 03:573,14763,640,69434,618,00002,277,376
10Mar 27, 2026 03:573,14864,386,65333,613,0001,018,0002,277,376
11Mar 27, 2026 03:573,14965,120,46433,621,0001,018,0002,277,376
12Mar 27, 2026 03:573,14960,296,52933,624,0001,018,0002,277,376
13Mar 27, 2026 03:573,15168,899,93134,666,00002,396,160
14Mar 27, 2026 03:573,15258,199,26334,671,00002,519,040
15Mar 27, 2026 03:573,15261,622,04833,654,0001,019,0002,494,464
16Mar 27, 2026 03:573,15364,552,55734,685,00002,277,376
17Mar 27, 2026 03:573,15463,502,24534,696,00002,277,376
18Mar 27, 2026 03:573,15561,299,20333,682,0001,020,0002,281,472
19Mar 27, 2026 03:573,16460,236,83034,802,00002,277,376
20Mar 27, 2026 03:573,16763,271,26234,834,00002,392,064
21Mar 27, 2026 03:573,16860,834,59533,851,000995,0002,277,376
22Mar 27, 2026 03:573,17060,860,00533,874,000996,0002,277,376
23Mar 27, 2026 03:573,17163,237,60733,886,000996,0002,396,160
24Mar 27, 2026 03:573,17662,349,59632,944,0001,996,0002,396,160