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 27, 2026 07:07olliecrowolliecrowScore: 3,148Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 27, 2026 07:073,13960,994,58233,516,0001,015,0002,400,256
2Mar 27, 2026 07:073,13960,255,85034,532,00002,277,376
3Mar 27, 2026 07:073,13957,707,79333,517,0001,015,0002,400,256
4Mar 27, 2026 07:073,14162,889,61033,539,0001,016,0002,387,968
5Mar 27, 2026 07:073,14158,825,08833,540,0001,016,0002,392,064
6Mar 27, 2026 07:073,14263,595,19633,541,0001,016,0002,404,352
7Mar 27, 2026 07:073,14456,537,93733,565,0001,017,0002,277,376
8Mar 27, 2026 07:073,14460,985,86534,580,00002,277,376
9Mar 27, 2026 07:073,14561,024,64933,578,0001,017,0002,392,064
10Mar 27, 2026 07:073,14565,318,59434,596,00002,396,160
11Mar 27, 2026 07:073,14562,631,92333,573,0001,017,0002,277,376
12Mar 27, 2026 07:073,14755,059,40633,602,0001,018,0002,404,352
13Mar 27, 2026 07:073,14862,323,07133,611,0001,018,0002,277,376
14Mar 27, 2026 07:073,14963,991,07233,622,0001,018,0002,277,376
15Mar 27, 2026 07:073,14960,869,09833,618,0001,018,0002,400,256
16Mar 27, 2026 07:073,14959,293,23633,620,0001,018,0002,277,376
17Mar 27, 2026 07:073,15066,999,91133,635,0001,019,0002,408,448
18Mar 27, 2026 07:073,15459,179,88033,672,0001,020,0002,277,376
19Mar 27, 2026 07:073,16460,764,14133,813,000994,0002,277,376
20Mar 27, 2026 07:073,16962,496,30234,860,00002,400,256
21Mar 27, 2026 07:073,17061,977,19334,866,00002,277,376
22Mar 27, 2026 07:073,17066,823,28934,868,00002,392,064
23Mar 27, 2026 07:073,17458,624,54632,916,0001,994,0002,396,160
24Mar 27, 2026 07:073,18058,553,18432,979,0001,998,0002,277,376