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:55olliecrowolliecrowScore: 3,166Success
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:553,13858,907,87233,500,0001,015,0002,404,352
2Mar 27, 2026 06:553,13958,566,23134,527,00002,277,376
3Mar 27, 2026 06:553,14161,086,17334,551,00002,400,256
4Mar 27, 2026 06:553,14461,259,24834,581,00002,519,040
5Mar 27, 2026 06:553,14563,253,72233,573,0001,017,0002,404,352
6Mar 27, 2026 06:553,14564,144,48934,595,00002,404,352
7Mar 27, 2026 06:553,14659,615,15333,593,0001,017,0002,383,872
8Mar 27, 2026 06:553,14862,393,06733,615,0001,018,0002,277,376
9Mar 27, 2026 06:553,14963,247,97934,644,00002,277,376
10Mar 27, 2026 06:553,15362,022,64534,685,00002,277,376
11Mar 27, 2026 06:553,15460,398,69134,689,00002,400,256
12Mar 27, 2026 06:553,15768,715,20332,748,0001,984,0002,400,256
13Mar 27, 2026 06:553,16659,500,40433,835,000995,0002,396,160
14Mar 27, 2026 06:553,16761,445,62133,837,000995,0002,404,352
15Mar 27, 2026 06:553,16864,842,81234,845,00002,400,256
16Mar 27, 2026 06:553,16859,101,35832,852,0001,991,0002,277,376
17Mar 27, 2026 06:553,16861,536,50833,848,000995,0002,277,376
18Mar 27, 2026 06:553,16968,171,46632,863,0001,991,0002,392,064
19Mar 27, 2026 06:553,17062,722,18032,881,0001,992,0002,277,376
20Mar 27, 2026 06:553,17362,082,67233,906,000997,0002,277,376
21Mar 27, 2026 06:553,17356,220,49733,911,000997,0002,400,256
22Mar 27, 2026 06:553,17661,699,99432,936,0001,996,0002,277,376
23Mar 27, 2026 06:553,17669,669,51333,912,0001,027,0002,277,376
24Mar 27, 2026 06:553,17759,133,07032,955,0001,997,0002,277,376