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 08:44olliecrowolliecrowScore: 3,168Success
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 08:443,13756,144,44133,490,0001,014,0002,404,352
2Mar 27, 2026 08:443,13758,258,27334,506,00002,277,376
3Mar 27, 2026 08:443,13957,059,18233,515,0001,015,0002,277,376
4Mar 27, 2026 08:443,14260,012,02734,567,00002,510,848
5Mar 27, 2026 08:443,14359,192,89034,578,00002,396,160
6Mar 27, 2026 08:443,14562,163,93334,590,00002,404,352
7Mar 27, 2026 08:443,14561,128,73533,576,0001,017,0002,277,376
8Mar 27, 2026 08:443,14569,003,34434,600,00002,416,640
9Mar 27, 2026 08:443,14659,858,62234,604,00002,400,256
10Mar 27, 2026 08:443,14864,775,18134,625,00002,277,376
11Mar 27, 2026 08:443,15161,258,50633,647,0001,019,0002,396,160
12Mar 27, 2026 08:443,16765,588,47133,847,000995,0002,277,376
13Mar 27, 2026 08:443,16864,305,55332,853,0001,991,0002,277,376
14Mar 27, 2026 08:443,16864,970,75533,854,000995,0002,392,064
15Mar 27, 2026 08:443,16859,768,26933,848,000995,0002,277,376
16Mar 27, 2026 08:443,16864,069,17333,857,000995,0002,277,376
17Mar 27, 2026 08:443,16962,660,36433,839,0001,025,0002,277,376
18Mar 27, 2026 08:443,16965,150,04633,861,000995,0002,277,376
19Mar 27, 2026 08:443,17167,375,03833,880,000996,0002,277,376
20Mar 27, 2026 08:443,17267,460,71933,896,000996,0002,277,376
21Mar 27, 2026 08:443,17260,673,83133,892,000996,0002,277,376
22Mar 27, 2026 08:443,17356,753,34632,914,0001,994,0002,277,376
23Mar 27, 2026 08:443,17357,289,21932,908,0001,994,0002,277,376
24Mar 27, 2026 08:443,17660,227,00332,941,0001,996,0002,396,160