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 listFeb 19, 2026 02:29Josu San MartinJosu San MartinScore: 3,118Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 19, 2026 02:333,10056,149,73832,093,0002,005,0002,277,376
2Feb 19, 2026 02:293,10354,988,48932,126,0002,007,0002,277,376
3Feb 19, 2026 02:293,10661,927,06332,158,0002,009,0002,400,256
4Feb 19, 2026 02:333,11055,336,63632,194,0002,012,0002,400,256
5Feb 19, 2026 02:293,11456,964,51232,243,0002,015,0002,404,352
6Feb 19, 2026 02:333,11456,820,83332,235,0002,014,0002,392,064
7Feb 19, 2026 02:293,11560,221,30432,245,0002,015,0002,408,448
8Feb 19, 2026 02:333,11661,120,68032,256,0002,016,0002,400,256
9Feb 19, 2026 02:333,11758,006,84934,288,00002,277,376
10Feb 19, 2026 02:293,11856,990,04133,290,0001,008,0002,277,376
11Feb 19, 2026 02:293,11860,323,31533,295,0001,008,0002,277,376
12Feb 19, 2026 02:333,12256,404,88733,337,0001,010,0002,277,376
13Feb 19, 2026 02:333,12362,061,98234,358,00002,392,064
14Feb 19, 2026 02:293,12461,006,01734,362,00002,277,376
15Feb 19, 2026 02:293,12455,947,27433,353,0001,010,0002,514,944
16Feb 19, 2026 02:333,12455,691,18234,369,00002,277,376
17Feb 19, 2026 02:293,12756,855,22734,394,00002,277,376
18Feb 19, 2026 02:333,13555,861,05633,471,0001,014,0002,392,064