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 listMay 8, 2026 20:40Daniel MastalerzDaniel MastalerzScore: 3,380Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 8, 2026 20:413,36554,379,43635,873,0001,152,0002,383,872
2May 8, 2026 20:413,37353,599,73536,048,0001,062,0002,392,064
3May 8, 2026 20:413,37750,998,54836,010,0001,147,0002,383,872
4May 8, 2026 20:413,37855,888,45736,142,0001,020,0002,383,872
5May 8, 2026 20:413,38053,811,97436,166,0001,020,0002,392,064
6May 8, 2026 20:413,38755,442,57636,187,0001,078,0002,375,680
7May 8, 2026 20:413,39055,196,10936,276,0001,020,0002,387,968
8May 8, 2026 20:413,39857,080,79936,358,0001,020,0002,387,968
9May 8, 2026 20:413,40055,646,12636,347,0001,055,0002,387,968