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 listSep 26, 2025 17:56Wookyung JeongWookyung JeongScore: 40,926Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 26, 2025 18:0040,825470,430,448426,070,00023,003,0002,355,200
2Sep 26, 2025 17:5640,868474,477,283425,573,00023,975,0002,383,872
3Sep 26, 2025 17:5840,869473,513,348418,590,00030,969,0002,502,656
4Sep 26, 2025 18:0040,871475,427,994409,617,00039,962,0002,351,104
5Sep 26, 2025 17:5640,873476,534,967412,637,00036,967,0002,334,720
6Sep 26, 2025 18:0040,880472,857,589419,702,00029,978,0002,510,848
7Sep 26, 2025 17:5540,887472,040,400428,772,00020,988,0002,408,448
8Sep 26, 2025 17:5640,893478,477,044420,839,00028,988,0002,314,240
9Sep 26, 2025 17:5840,896475,488,298415,872,00033,989,0002,506,752
10Sep 26, 2025 17:5640,898471,958,819419,889,00029,992,0002,498,560
11Sep 26, 2025 18:0040,911472,830,080419,020,00031,001,0002,449,408
12Sep 26, 2025 17:5640,913480,840,687427,044,00023,002,0002,396,160
13Sep 26, 2025 17:5640,919471,757,021413,101,00037,009,0002,334,720
14Sep 26, 2025 17:5640,926474,092,403416,173,00034,014,0002,301,952
15Sep 26, 2025 17:5640,931477,645,094421,224,00029,015,0002,510,848
16Sep 26, 2025 17:5640,933479,245,684427,255,00023,013,0002,482,176
17Sep 26, 2025 18:0040,934478,754,754424,263,00026,016,0002,510,848
18Sep 26, 2025 18:0040,934475,234,798422,260,00028,017,0002,347,008
19Sep 26, 2025 17:5640,934475,689,130422,257,00028,017,0002,387,968
20Sep 26, 2025 17:5540,936474,058,508411,272,00039,025,0002,416,640
21Sep 26, 2025 17:5640,955475,345,963421,534,00028,968,0002,273,280
22Sep 26, 2025 17:5540,963478,965,843416,546,00034,044,0002,301,952
23Sep 26, 2025 17:5640,970476,417,369421,688,00028,978,0002,342,912
24Sep 26, 2025 17:5640,985478,536,223413,847,00036,986,0002,342,912
25Sep 26, 2025 17:5641,004473,305,717419,038,00032,002,0002,400,256
26Sep 26, 2025 17:5841,008474,397,357410,079,00041,007,0002,273,280
27Sep 26, 2025 17:5641,055478,265,055416,631,00034,969,0002,465,792