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 28, 2026 05:37olliecrowolliecrowScore: 3,294Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 28, 2026 05:373,27860,404,44834,060,0002,003,0002,285,568
2Mar 28, 2026 05:143,28160,301,51735,092,0001,002,0002,404,352
3Mar 28, 2026 05:133,28256,252,17234,098,0002,005,0002,404,352
4Mar 28, 2026 05:503,28361,615,35335,109,0001,003,0002,510,848
5Mar 28, 2026 05:133,28858,037,82135,160,0001,004,0002,285,568
6Mar 28, 2026 05:503,29358,419,71034,208,0002,012,0002,285,568
7Mar 28, 2026 05:503,29361,045,40834,216,0002,012,0002,408,448
8Mar 28, 2026 05:093,29459,458,38935,223,0001,006,0002,400,256
9Mar 28, 2026 05:093,29458,586,55535,225,0001,006,0002,404,352
10Mar 28, 2026 05:143,29858,382,81436,281,00002,285,568
11Mar 28, 2026 05:133,30558,846,67535,349,0001,009,0002,285,568
12Mar 28, 2026 05:093,30760,124,84035,363,0001,010,0002,285,568
13Mar 28, 2026 05:373,30757,311,08135,363,0001,010,0002,285,568
14Mar 28, 2026 05:373,33365,817,62236,662,00002,285,568
15Mar 28, 2026 05:143,34963,612,21134,852,0001,991,0002,285,568