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:16olliecrowolliecrowScore: 3,149Success
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:163,13654,974,51134,491,00002,277,376
2Mar 27, 2026 05:163,13657,560,07233,478,0001,014,0002,277,376
3Mar 27, 2026 05:163,14056,429,72833,522,0001,015,0002,277,376
4Mar 27, 2026 05:163,14060,771,98533,525,0001,015,0002,277,376
5Mar 27, 2026 05:163,14253,679,55534,559,00002,277,376
6Mar 27, 2026 05:163,14460,022,15134,584,00002,392,064
7Mar 27, 2026 05:163,14563,497,93133,583,0001,017,0002,277,376
8Mar 27, 2026 05:163,14561,034,81833,582,0001,017,0002,473,984
9Mar 27, 2026 05:163,14558,816,45933,583,0001,017,0002,277,376
10Mar 27, 2026 05:163,14866,007,36333,615,0001,018,0002,277,376
11Mar 27, 2026 05:163,14861,997,32533,613,0001,018,0002,408,448
12Mar 27, 2026 05:163,14960,058,95434,634,00002,519,040
13Mar 27, 2026 05:163,14960,848,31234,639,00002,396,160
14Mar 27, 2026 05:163,15064,118,90634,648,00002,510,848
15Mar 27, 2026 05:163,15360,491,03434,686,00002,277,376
16Mar 27, 2026 05:163,15460,842,17334,694,00002,404,352
17Mar 27, 2026 05:163,15563,623,95433,685,0001,020,0002,277,376
18Mar 27, 2026 05:163,15559,807,77734,707,00002,277,376
19Mar 27, 2026 05:163,16761,079,58033,842,000995,0002,396,160
20Mar 27, 2026 05:163,16859,295,42032,861,0001,991,0002,404,352
21Mar 27, 2026 05:163,16859,674,78833,856,000995,0002,277,376
22Mar 27, 2026 05:163,16959,147,85132,868,0001,992,0002,277,376
23Mar 27, 2026 05:163,17062,139,44332,879,0001,992,0002,404,352
24Mar 27, 2026 05:163,17066,893,43033,870,000996,0002,277,376