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 01:54olliecrowolliecrowError
Source Code

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

Challenge History
DateChallengerCostTypeStatus
Sep 8, 2026 06:29C#_user10.00CustomSolution Broken
Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 8, 2026 06:35018,585,8158,609,00002,117,632expected "2 ", got "0 "
2Sep 8, 2026 06:35018,636,3678,670,00002,117,632expected "2 ", got "0 "
3Sep 8, 2026 06:35018,721,5847,707,0001,014,0002,117,632expected "2 ", got "0 "
4Mar 27, 2026 01:543,13157,884,31433,424,0001,012,0002,400,256
5Mar 27, 2026 01:543,13755,433,34633,488,0001,014,0002,392,064
6Mar 27, 2026 01:543,14055,893,10733,523,0001,015,0002,392,064
7Mar 27, 2026 01:543,14161,496,32133,536,0001,016,0002,277,376
8Apr 16, 2026 02:573,14459,444,61533,570,0001,017,0002,277,376
9Mar 27, 2026 01:543,14564,017,67234,598,00002,277,376
10Mar 27, 2026 01:543,14658,165,99734,601,00002,392,064
11Mar 27, 2026 01:543,14766,612,74234,617,00002,277,376
12Mar 27, 2026 01:543,14761,941,96034,614,00002,277,376
13Mar 27, 2026 01:543,14862,308,27133,608,0001,018,0002,277,376
14Mar 27, 2026 01:543,14862,354,33333,606,0001,018,0002,400,256
15Mar 27, 2026 01:543,14863,605,81333,607,0001,018,0002,490,368
16Apr 16, 2026 02:573,14963,976,12834,641,00002,277,376
17Mar 27, 2026 01:543,15057,160,21233,633,0001,019,0002,277,376
18Mar 27, 2026 01:543,15060,341,35334,648,00002,277,376
19Apr 16, 2026 02:573,15065,153,45934,646,00002,383,872
20Mar 27, 2026 01:543,15164,620,76633,646,0001,019,0002,277,376
21Mar 27, 2026 01:543,15161,834,84233,641,0001,019,0002,277,376
22Mar 27, 2026 01:543,15160,325,31833,644,0001,019,0002,277,376
23Mar 27, 2026 01:543,15762,047,48332,743,0001,984,0002,277,376
24Mar 27, 2026 01:543,16761,710,91334,839,00002,277,376
25Mar 27, 2026 01:543,16862,809,97834,843,00002,277,376
26Mar 27, 2026 01:543,16959,394,58733,868,000996,0002,277,376
27Mar 27, 2026 01:543,17259,882,80132,897,0001,993,0002,277,376
28Mar 27, 2026 01:543,17556,800,17032,934,0001,996,0002,400,256
29Mar 27, 2026 01:543,17663,833,05833,935,000998,0002,277,376
30Mar 27, 2026 01:543,17857,723,14633,956,000998,0002,277,376