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:25olliecrowolliecrowScore: 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:253,13158,144,59133,427,0001,012,0002,277,376
2Mar 27, 2026 03:253,13161,221,66034,444,00002,277,376
3Mar 27, 2026 03:253,14255,848,89634,567,00002,396,160
4Mar 27, 2026 03:253,14258,042,98233,544,0001,016,0002,404,352
5Mar 27, 2026 03:253,14260,798,65933,541,0001,016,0002,400,256
6Mar 27, 2026 03:253,14363,180,52734,576,00002,277,376
7Mar 27, 2026 03:253,14663,537,33733,584,0001,017,0002,277,376
8Mar 27, 2026 03:253,14860,196,01233,614,0001,018,0002,396,160
9Mar 27, 2026 03:253,14962,719,13634,640,00002,478,080
10Mar 27, 2026 03:253,14967,137,53033,620,0001,018,0002,277,376
11Mar 27, 2026 03:253,15166,258,65633,643,0001,019,0002,392,064
12Mar 27, 2026 03:253,15265,238,84634,671,00002,277,376
13Mar 27, 2026 03:253,15561,849,31233,682,0001,020,0002,277,376
14Mar 27, 2026 03:253,16659,486,94432,838,0001,990,0002,277,376
15Mar 27, 2026 03:253,16860,552,12332,854,0001,991,0002,277,376
16Mar 27, 2026 03:253,16864,894,75133,848,000995,0002,277,376
17Mar 27, 2026 03:253,16864,237,76833,852,000995,0002,400,256
18Mar 27, 2026 03:253,16964,577,26832,867,0001,991,0002,277,376
19Mar 27, 2026 03:253,17555,753,76833,931,000997,0002,277,376
20Mar 27, 2026 03:253,17863,243,38432,958,0001,997,0002,277,376
21Mar 27, 2026 03:253,18162,591,45932,987,0001,999,0002,277,376