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 15, 2026 23:56Dominique GarmierDominique GarmierScore: 11,238Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 15, 2026 23:5311,193147,780,986121,125,0002,002,0002,289,664
2Mar 15, 2026 23:5311,196149,320,788121,159,0002,002,0002,289,664
3Mar 15, 2026 23:5311,198156,786,775121,179,0002,002,0002,387,968
4Mar 15, 2026 23:5311,201147,217,326120,208,0003,005,0002,285,568
5Mar 16, 2026 00:0011,206149,680,776121,263,0002,004,0002,273,280
6Mar 16, 2026 00:0111,210149,803,170121,301,0002,004,0002,269,184
7Mar 19, 2026 17:0811,225146,836,051122,467,0001,003,0002,277,376
8Mar 16, 2026 00:0111,228148,204,794122,501,0001,004,0002,277,376
9Mar 16, 2026 00:0011,229150,947,520122,514,0001,004,0002,289,664
10Mar 16, 2026 00:0111,229145,613,334122,510,0001,004,0002,277,376
11Mar 15, 2026 23:5311,229147,321,188123,514,00002,289,664
12Mar 16, 2026 00:0111,232147,572,867122,552,0001,004,0002,289,664
13Mar 15, 2026 23:5311,234158,493,969122,573,0001,004,0002,289,664
14Mar 16, 2026 00:0111,238152,020,906122,614,0001,005,0002,289,664
15Mar 15, 2026 23:5311,239149,016,360122,624,0001,005,0002,289,664
16Mar 19, 2026 17:0811,255152,576,895122,810,000998,0002,289,664
17Mar 15, 2026 23:5611,263152,380,820121,891,0001,998,0002,289,664
18Mar 16, 2026 00:0011,263149,730,789122,898,000999,0002,281,472
19Mar 16, 2026 00:0111,268153,686,223122,944,000999,0002,273,280
20Mar 15, 2026 23:5311,273160,857,156122,003,0002,000,0002,289,664
21Mar 16, 2026 00:0111,275151,562,846123,030,0001,000,0002,289,664
22Mar 19, 2026 17:0811,280156,792,663123,077,0001,000,0002,273,280
23Mar 15, 2026 23:5611,287154,181,158123,157,0001,001,0002,289,664
24Mar 16, 2026 00:0111,289152,698,897122,182,0002,002,0002,289,664
25Mar 16, 2026 00:0111,313152,447,906122,441,0002,007,0002,269,184
26Mar 15, 2026 23:5311,347151,505,665122,820,0001,997,0002,289,664
27Mar 15, 2026 23:5611,373149,684,764123,097,0002,001,0002,289,664