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 05:53olliecrowolliecrowScore: 3,150Success
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 05:533,14155,340,81834,554,00002,277,376
2Mar 27, 2026 05:533,14256,322,85134,563,00002,519,040
3Mar 27, 2026 05:533,14464,099,19634,580,00002,494,464
4Mar 27, 2026 05:533,14666,058,16233,591,0001,017,0002,400,256
5Mar 27, 2026 05:533,14764,882,85634,618,00002,277,376
6Mar 27, 2026 05:533,14763,697,61633,604,0001,018,0002,396,160
7Mar 27, 2026 05:533,14762,727,05533,601,0001,018,0002,277,376
8Mar 27, 2026 05:533,14863,354,52133,615,0001,018,0002,400,256
9Mar 27, 2026 05:533,14861,744,61534,624,00002,396,160
10Mar 27, 2026 05:533,14960,574,87633,623,0001,018,0002,277,376
11Mar 27, 2026 05:533,15063,868,69933,635,0001,019,0002,396,160
12Mar 27, 2026 05:533,15059,502,48033,635,0001,019,0002,277,376
13Mar 27, 2026 05:533,15062,515,65934,653,00002,277,376
14Mar 27, 2026 05:533,15061,827,22633,629,0001,019,0002,404,352
15Mar 27, 2026 05:533,15166,785,41134,656,00002,396,160
16Mar 27, 2026 05:533,15260,809,80833,658,0001,019,0002,277,376
17Mar 27, 2026 05:533,15266,076,90533,649,0001,019,0002,277,376
18Mar 27, 2026 05:533,15362,623,26233,666,0001,020,0002,277,376
19Mar 27, 2026 05:533,15559,868,00433,689,0001,020,0002,277,376
20Mar 27, 2026 05:533,16863,323,10132,854,0001,991,0002,400,256
21Mar 27, 2026 05:533,16968,853,38834,861,00002,392,064
22Mar 27, 2026 05:533,17158,913,48732,891,0001,993,0002,277,376
23Mar 27, 2026 05:533,17457,522,85732,920,0001,995,0002,277,376
24Mar 27, 2026 05:533,17559,704,48932,928,0001,995,0002,482,176