✅ Straightforward and Understandable Solution ✅
Intuition\nThe problem requires filtering orders placed in February 2020, then aggregating the units ordered for each product, and finally selecting those produ
# Intuition\nThe problem requires filtering orders placed in February 2020, then aggregating the units ordered for each product, and finally selecting those products that meet the 100 unit threshold. This suggests a series of steps involving filtering, merging, grouping, and filtering again. Crucially, handling dates correctly is important.\n\n# Approach\n1. Filter Orders: First, filter the orders DataFrame to only include orders placed in February 2020. This requires converting the order_date column to a datetime format for proper comparison.\n2. Merge with Products: Merge the filtered orders DataFrame with the products DataFrame using the product_id column as a key. This links order information to the product details.\n3. Group and Aggregate: Group the merged DataFrame by product_name and calculate the sum of unit for each product name. This gives the total units ordered per product in February 2020.\n4. Filter by Threshold: Filter the result to keep only those products where the total units ordered are 100 or more.\n5. Select Desired Columns: Return a DataFrame containing only the product_name and unit columns.\n\n# Complexity\n- Time complexity:\n$$O(n + m)$$\nwhere n is the number of rows in the orders DataFrame and m is the number of rows in the products DataFrame. This is because of the merging and grouping operations. Pandas operations are optimized, but the basic complexity is determined by the data size.\n\n- Space complexity:\n$$O(max(n, m))$$\nThe space required to store intermediate results (e.g., the merged DataFrame) is determined by the size of the larger of the two input DataFrames. In the worst case, all rows will need to be stored.\n\n# Code\n```pythondata []\nimport pandas as pd\n\ndef list_products(products: pd.DataFrame, orders: pd.DataFrame) -> pd.DataFrame:\n    # Filter orders for February 2020\n    february_2020_orders = orders[orders[\'order_date\'].dt.year == 2020]\n    february_2020_orders = february_2020_orders[orders[\'order_date\'].dt.month == 2]\n\n\n    # Merge with products table\n    merged = pd.merge(february_2020_orders, products, on=\'product_id\')\n\n    # Group by product name and sum units\n    result = merged.groupby(\'product_name\')[\'unit\'].sum().reset_index()\n\n    # Filter for products with at least 100 units ordered\n    result = result[result[\'unit\'] >= 100]\n\n\n    return result[[\'product_name\', \'unit\']]\n```
['Python3', 'Pandas']