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 06:50olliecrowolliecrowError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 03:41C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 03:41018,770,8697,744,0001,026,0002,117,632expected "2 ", got "0 "
2Sep 8, 2026 03:41018,604,6837,704,0001,023,0002,117,632expected "2 ", got "0 "
3Sep 8, 2026 03:41018,570,1877,496,0001,127,0002,117,632expected "2 ", got "0 "
4Mar 27, 2026 06:503,13659,518,00434,501,00002,277,376
5Mar 27, 2026 06:503,13656,678,12134,497,00002,277,376
6Mar 27, 2026 06:503,13656,268,58733,485,0001,014,0002,396,160
7Mar 27, 2026 06:503,13861,837,31534,514,00002,277,376
8Mar 27, 2026 06:503,13960,274,10834,531,00002,281,472
9Mar 27, 2026 06:503,14156,676,27734,552,00002,396,160
10Mar 27, 2026 06:503,14263,679,29834,559,00002,396,160
11Mar 27, 2026 06:503,14262,540,87534,563,00002,277,376
12Mar 27, 2026 06:503,14355,085,93933,559,0001,016,0002,400,256
13Mar 27, 2026 06:503,14360,177,33234,570,00002,277,376
14Mar 27, 2026 06:503,14665,454,01833,590,0001,017,0002,277,376
15Mar 27, 2026 06:503,14767,975,84534,619,00002,408,448
16Mar 27, 2026 06:503,14763,996,82933,597,0001,018,0002,396,160
17Mar 27, 2026 06:503,15062,920,48633,632,0001,019,0002,396,160
18Mar 27, 2026 06:503,15170,889,44733,646,0001,019,0002,404,352
19Mar 27, 2026 06:503,15165,073,46333,643,0001,019,0002,277,376
20Mar 27, 2026 06:503,15269,659,30333,658,0001,019,0002,277,376
21Mar 27, 2026 06:503,16757,710,50933,839,000995,0002,519,040
22Mar 27, 2026 06:503,16760,180,84232,850,0001,990,0002,387,968
23Mar 27, 2026 06:503,16865,899,00133,854,000995,0002,277,376
24Mar 27, 2026 06:503,16867,733,47832,855,0001,991,0002,277,376
25Mar 27, 2026 06:503,16857,260,21232,854,0001,991,0002,396,160
26Mar 27, 2026 06:503,16962,152,75133,859,000995,0002,396,160
27Mar 27, 2026 06:503,17361,850,19232,906,0001,994,0002,277,376