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 20, 2026 09:28Dominique GarmierDominique GarmierScore: 6,403Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 20, 2026 09:266,363101,634,42368,993,000999,0002,326,528
2Mar 20, 2026 11:316,377102,013,87868,138,0002,004,0002,330,624
3Mar 20, 2026 09:306,37897,396,40069,154,0001,002,0002,506,752
4Mar 20, 2026 09:266,38496,688,87368,215,0002,006,0002,330,624
5Mar 20, 2026 09:286,38798,679,87268,251,0002,007,0002,494,464
6Mar 20, 2026 09:286,38996,501,73968,269,0002,007,0002,330,624
7Mar 20, 2026 09:286,38999,067,62570,280,00002,347,008
8Mar 20, 2026 09:306,39198,008,89568,292,0002,008,0002,502,656
9Mar 20, 2026 09:306,392101,907,07868,303,0002,008,0002,326,528
10Mar 20, 2026 09:286,39298,264,87568,307,0002,009,0002,506,752
11Mar 20, 2026 09:306,39396,080,15169,323,0001,004,0002,330,624
12Mar 20, 2026 09:286,395103,984,10869,352,000990,0002,502,656
13Mar 20, 2026 09:306,400100,246,45268,386,0002,011,0002,498,560
14Mar 20, 2026 09:286,40199,057,16269,401,0001,005,0002,506,752
15Mar 20, 2026 09:286,40197,355,80768,399,0002,011,0002,326,528
16Mar 20, 2026 09:306,40293,325,68669,414,0001,006,0002,494,464
17Mar 20, 2026 09:266,403100,490,73969,425,0001,006,0002,330,624
18Mar 20, 2026 09:286,404101,695,61669,443,0001,006,0002,494,464
19Mar 20, 2026 09:286,40598,941,82669,445,0001,006,0002,326,528
20Mar 20, 2026 11:316,40696,609,95770,462,00002,330,624
21Mar 20, 2026 09:306,40698,241,85369,464,0001,006,0002,326,528
22Mar 20, 2026 09:266,41095,393,79670,512,00002,330,624
23Mar 20, 2026 09:266,412101,657,59369,530,0001,007,0002,506,752
24Mar 20, 2026 09:306,41396,538,79669,541,0001,007,0002,330,624
25Mar 20, 2026 09:266,41699,350,14469,564,0001,008,0002,502,656
26Mar 20, 2026 11:316,41798,061,78770,591,00002,330,624
27Mar 20, 2026 09:286,418103,536,91069,589,0001,008,0002,326,528
28Mar 20, 2026 09:306,418101,975,83769,586,0001,008,0002,326,528
29Mar 20, 2026 09:286,41898,148,66270,595,00002,502,656
30Mar 20, 2026 09:266,423100,806,95270,658,00002,322,432
31Mar 20, 2026 09:266,43996,961,19668,832,0001,995,0002,330,624
32Mar 20, 2026 09:286,440101,067,69168,847,0001,995,0002,330,624
33Mar 20, 2026 09:266,44597,348,42069,895,000998,0002,322,432