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 19:40Dominique GarmierDominique GarmierScore: 492,671Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 21, 2026 02:16485,2405,367,487,9785,305,669,00031,973,0002,293,760
2Mar 21, 2026 03:20486,2155,383,737,1685,305,376,00042,986,0002,482,176
3Mar 20, 2026 16:57487,8985,398,391,8515,333,902,00032,980,0002,375,680
4Mar 20, 2026 14:47488,0425,403,194,8545,329,476,00038,981,0002,306,048
5Mar 13, 2026 11:46488,1305,396,293,0265,344,452,00024,983,0002,478,080
6Mar 21, 2026 03:20488,3295,400,374,4845,331,641,00039,974,0002,478,080
7Mar 21, 2026 02:16489,0485,407,510,6425,342,548,00036,976,0002,482,176
8Mar 20, 2026 16:57489,2275,410,609,9365,346,518,00034,983,0002,363,392
9Mar 13, 2026 11:46489,4515,416,059,1595,352,983,00030,976,0002,326,528
10Mar 20, 2026 19:40489,6335,422,198,4765,357,982,00027,984,0002,379,776
11Mar 20, 2026 14:47491,0035,444,346,8765,363,061,00037,972,0002,293,760
12Mar 13, 2026 11:46491,0905,435,465,4685,361,012,00040,977,0002,334,720
13Mar 20, 2026 14:47491,3205,439,464,1655,365,549,00038,974,0002,338,816
14Mar 20, 2026 14:47492,1095,439,084,3255,372,221,00040,978,0002,293,760
15Mar 13, 2026 11:46492,2505,446,395,7265,384,779,00029,976,0002,347,008
16Mar 20, 2026 14:47492,6715,450,107,8805,383,409,00035,969,0002,338,816
17Mar 21, 2026 03:20493,0375,456,481,0405,389,431,00033,971,0002,334,720
18Mar 13, 2026 11:46493,0495,454,912,5485,372,568,00050,967,0002,367,488
19Mar 20, 2026 15:05493,2865,456,045,6175,387,144,00039,001,0002,539,520
20Mar 13, 2026 11:46494,3965,467,561,1585,407,378,00030,979,0002,490,368
21Mar 20, 2026 15:05497,1235,501,528,7605,429,380,00038,974,0002,506,752
22Mar 13, 2026 11:46497,7905,505,605,2825,441,709,00033,979,0002,449,408
23Mar 21, 2026 02:16498,2385,515,637,0665,444,646,00035,971,0002,555,904
24Mar 20, 2026 19:40499,1355,519,756,2785,444,512,00045,970,0002,539,520
25Mar 20, 2026 19:40499,7645,527,155,5745,460,411,00036,989,0002,424,832
26Mar 13, 2026 11:46500,9215,541,654,0715,473,161,00036,967,0002,527,232
27Mar 13, 2026 11:46504,0795,575,716,3635,508,888,00035,979,0002,322,432
28Mar 20, 2026 16:57504,6165,580,730,9085,512,803,00037,971,0002,433,024
29Mar 20, 2026 14:47514,3115,689,377,3525,607,458,00049,968,0002,318,336
30Mar 20, 2026 15:05521,3885,765,882,2545,697,290,00037,975,0002,285,568