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 22, 2026 11:39Dominique GarmierDominique GarmierScore: 6,678Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 25, 2026 12:326,65897,469,42271,229,0002,006,0002,330,624
2Mar 22, 2026 15:296,66397,681,80772,285,0001,003,0002,338,816
3Mar 25, 2026 02:576,66395,688,66473,289,00002,334,720
4Mar 22, 2026 19:136,666103,045,34873,325,00002,334,720
5Mar 22, 2026 11:396,671105,839,19172,373,0001,005,0002,330,624
6Mar 22, 2026 15:296,675105,033,11072,420,0001,005,0002,334,720
7Mar 22, 2026 19:136,677103,191,23272,439,0001,006,0002,330,624
8Mar 25, 2026 02:576,678100,881,30072,454,0001,006,0002,342,912
9Mar 25, 2026 12:326,679100,340,56672,459,0001,006,0002,338,816
10Mar 25, 2026 12:326,680102,151,84573,476,00002,330,624
11Mar 22, 2026 19:136,68398,089,05173,509,00002,330,624
12Mar 22, 2026 11:396,697102,996,82172,660,0001,009,0002,334,720
13Mar 22, 2026 15:296,697102,655,37372,662,0001,009,0002,338,816
14Mar 25, 2026 02:576,714100,493,91371,856,0001,996,0002,338,816
15Mar 22, 2026 11:396,72898,655,23772,011,0002,000,0002,330,624