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 16:20Wookyung JeongWookyung JeongScore: 54,562Success
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 16:2154,355621,965,205565,910,00031,994,0002,347,008
2Sep 26, 2025 16:2154,371626,047,289567,077,00031,004,0002,306,048
3Sep 26, 2025 16:2154,377625,176,809574,140,00024,005,0002,326,528
4Sep 26, 2025 16:2054,379619,879,249570,159,00028,007,0002,306,048
5Sep 26, 2025 16:2154,398623,990,929568,405,00029,968,0002,363,392
6Sep 26, 2025 16:2154,412622,822,146575,546,00022,981,0002,310,144
7Sep 26, 2025 16:2154,430625,381,094574,745,00023,989,0002,306,048
8Sep 26, 2025 16:2154,474629,379,875575,203,00024,008,0002,498,560
9Sep 26, 2025 16:2154,484627,530,918574,307,00025,013,0002,306,048
10Sep 26, 2025 16:2054,500625,247,659573,519,00025,978,0002,510,848
11Sep 26, 2025 16:2154,548624,537,230566,031,00034,001,0002,359,296
12Sep 26, 2025 16:2154,551625,324,958578,060,00022,002,0002,310,144
13Sep 26, 2025 16:2154,560625,703,891564,150,00036,009,0002,330,624
14Sep 26, 2025 16:2054,562626,698,013575,175,00025,007,0002,277,376
15Sep 26, 2025 16:2154,577627,325,907573,332,00027,015,0002,396,160
16Sep 26, 2025 16:2054,587627,774,815565,486,00034,968,0002,347,008
17Sep 26, 2025 16:2054,590626,365,669569,521,00030,973,0002,400,256
18Sep 26, 2025 16:2054,590625,777,181573,512,00026,977,0002,306,048
19Sep 26, 2025 16:2154,594629,750,585558,566,00041,967,0002,301,952
20Sep 26, 2025 16:2154,601626,892,075564,575,00036,036,0002,306,048
21Sep 26, 2025 16:2154,604626,589,947570,662,00029,982,0002,338,816
22Sep 26, 2025 16:2154,615625,657,170562,776,00037,984,0002,326,528
23Sep 26, 2025 16:2054,635624,090,952565,988,00034,999,0002,289,664
24Sep 26, 2025 16:2154,663626,695,325569,281,00032,015,0002,322,432
25Sep 26, 2025 16:2054,685627,824,039564,564,00036,971,0002,506,752
26Sep 26, 2025 16:2154,689625,944,710577,601,00023,983,0002,293,760
27Sep 26, 2025 16:2054,784624,675,323564,652,00037,976,0002,482,176