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 06:21olliecrowolliecrowScore: 3,153Success
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 06:213,14256,786,40934,559,00002,387,968
2Mar 27, 2026 06:213,14362,939,61934,569,00002,277,376
3Mar 27, 2026 06:213,14363,242,98134,568,00002,392,064
4Mar 27, 2026 06:213,14459,512,48933,566,0001,017,0002,277,376
5Mar 27, 2026 06:213,14469,912,71033,572,0001,017,0002,277,376
6Mar 27, 2026 06:213,14560,293,25534,593,00002,277,376
7Mar 27, 2026 06:213,14860,804,92233,609,0001,018,0002,277,376
8Mar 27, 2026 06:213,14963,227,28333,619,0001,018,0002,400,256
9Mar 27, 2026 06:213,14964,471,07034,638,00002,514,944
10Mar 27, 2026 06:213,15062,093,38634,654,00002,404,352
11Mar 27, 2026 06:213,15166,346,64533,643,0001,019,0002,396,160
12Mar 27, 2026 06:213,15160,495,71234,661,00002,408,448
13Mar 27, 2026 06:213,15362,052,02134,678,00002,277,376
14Mar 27, 2026 06:213,15560,362,55733,681,0001,020,0002,277,376
15Mar 27, 2026 06:213,15560,772,83634,703,00002,277,376
16Mar 27, 2026 06:213,15663,153,31033,692,0001,020,0002,277,376
17Mar 27, 2026 06:213,15861,858,41533,713,0001,021,0002,404,352
18Mar 27, 2026 06:213,16760,446,66133,847,000995,0002,400,256
19Mar 27, 2026 06:213,16860,531,62034,851,00002,277,376
20Mar 27, 2026 06:213,16960,553,62832,867,0001,991,0002,277,376
21Mar 27, 2026 06:213,16963,232,39233,860,000995,0002,277,376
22Mar 27, 2026 06:213,17256,654,77334,892,00002,277,376
23Mar 27, 2026 06:213,17461,141,05533,918,000997,0002,392,064
24Mar 27, 2026 06:213,17660,964,32533,937,000998,0002,400,256