mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
存量题库数据更新
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
"boundTopicId": null,
|
||||
"title": "Recyclable and Low Fat Products",
|
||||
"titleSlug": "recyclable-and-low-fat-products",
|
||||
"content": "<p>Table: <code>Products</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| product_id | int |\n| low_fats | enum |\n| recyclable | enum |\n+-------------+---------+\nproduct_id is the primary key for this table.\nlow_fats is an ENUM of type ('Y', 'N') where 'Y' means this product is low fat and 'N' means it is not.\nrecyclable is an ENUM of types ('Y', 'N') where 'Y' means this product is recyclable and 'N' means it is not.</pre>\n\n<p> </p>\n\n<p>Write an SQL query to find the ids of products that are both low fat and recyclable.</p>\n\n<p>Return the result table in <strong>any order</strong>.</p>\n\n<p>The query result format is in the following example.</p>\n\n<p> </p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nProducts table:\n+-------------+----------+------------+\n| product_id | low_fats | recyclable |\n+-------------+----------+------------+\n| 0 | Y | N |\n| 1 | Y | Y |\n| 2 | N | Y |\n| 3 | Y | Y |\n| 4 | N | N |\n+-------------+----------+------------+\n<strong>Output:</strong> \n+-------------+\n| product_id |\n+-------------+\n| 1 |\n| 3 |\n+-------------+\n<strong>Explanation:</strong> Only products 1 and 3 are both low fat and recyclable.\n</pre>\n",
|
||||
"content": "<p>Table: <code>Products</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| product_id | int |\n| low_fats | enum |\n| recyclable | enum |\n+-------------+---------+\nproduct_id is the primary key (column with unique values) for this table.\nlow_fats is an ENUM (category) of type ('Y', 'N') where 'Y' means this product is low fat and 'N' means it is not.\nrecyclable is an ENUM (category) of types ('Y', 'N') where 'Y' means this product is recyclable and 'N' means it is not.</pre>\n\n<p> </p>\n\n<p>Write a solution to find the ids of products that are both low fat and recyclable.</p>\n\n<p>Return the result table in <strong>any order</strong>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nProducts table:\n+-------------+----------+------------+\n| product_id | low_fats | recyclable |\n+-------------+----------+------------+\n| 0 | Y | N |\n| 1 | Y | Y |\n| 2 | N | Y |\n| 3 | Y | Y |\n| 4 | N | N |\n+-------------+----------+------------+\n<strong>Output:</strong> \n+-------------+\n| product_id |\n+-------------+\n| 1 |\n| 3 |\n+-------------+\n<strong>Explanation:</strong> Only products 1 and 3 are both low fat and recyclable.\n</pre>\n",
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 188,
|
||||
"dislikes": 52,
|
||||
"likes": 1778,
|
||||
"dislikes": 94,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": "{\"headers\":{\"Products\":[\"product_id\",\"low_fats\",\"recyclable\"]},\"rows\":{\"Products\":[[\"0\",\"Y\",\"N\"],[\"1\",\"Y\",\"Y\"],[\"2\",\"N\",\"Y\"],[\"3\",\"Y\",\"Y\"],[\"4\",\"N\",\"N\"]]}}",
|
||||
@@ -45,14 +45,33 @@
|
||||
"langSlug": "oraclesql",
|
||||
"code": "/* Write your PL/SQL query statement below */\n",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "Pandas",
|
||||
"langSlug": "pythondata",
|
||||
"code": "import pandas as pd\n\ndef find_products(products: pd.DataFrame) -> pd.DataFrame:\n ",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "PostgreSQL",
|
||||
"langSlug": "postgresql",
|
||||
"code": "-- Write your PostgreSQL query statement below\n",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"44.7K\", \"totalSubmission\": \"47K\", \"totalAcceptedRaw\": 44736, \"totalSubmissionRaw\": 47019, \"acRate\": \"95.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"651.3K\", \"totalSubmission\": \"729.1K\", \"totalAcceptedRaw\": 651285, \"totalSubmissionRaw\": 729059, \"acRate\": \"89.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"solution": {
|
||||
"id": "2025",
|
||||
"canSeeDetail": true,
|
||||
"paidOnly": false,
|
||||
"hasVideoSolution": false,
|
||||
"paidOnlyVideo": true,
|
||||
"__typename": "ArticleNode"
|
||||
},
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Products\":[\"product_id\",\"low_fats\",\"recyclable\"]},\"rows\":{\"Products\":[[\"0\",\"Y\",\"N\"],[\"1\",\"Y\",\"Y\"],[\"2\",\"N\",\"Y\"],[\"3\",\"Y\",\"Y\"],[\"4\",\"N\",\"N\"]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Products (product_id int, low_fats ENUM('Y', 'N'), recyclable ENUM('Y','N'))\"\n ],\n \"mssql\": [\n \"Create table Products (product_id int, low_fats varchar(1) not null check(low_fats in ('Y', 'N')), recyclable varchar(1) not null check(recyclable in ('Y', 'N')))\"\n ],\n \"oraclesql\": [\n \"Create table Products (product_id int, low_fats varchar(1) not null check(low_fats in ('Y', 'N')), recyclable varchar(1) not null check(recyclable in ('Y', 'N')))\"\n ],\n \"database\": true\n}",
|
||||
"metaData": "{\"mysql\": [\"Create table If Not Exists Products (product_id int, low_fats ENUM('Y', 'N'), recyclable ENUM('Y','N'))\"], \"mssql\": [\"Create table Products (product_id int, low_fats varchar(1) not null check(low_fats in ('Y', 'N')), recyclable varchar(1) not null check(recyclable in ('Y', 'N')))\"], \"oraclesql\": [\"Create table Products (product_id int, low_fats varchar(1) not null check(low_fats in ('Y', 'N')), recyclable varchar(1) not null check(recyclable in ('Y', 'N')))\"], \"database\": true, \"name\": \"find_products\", \"pythondata\": [\"Products = pd.DataFrame([], columns=['product_id', 'low_fats', 'recyclable']).astype({'product_id':'int64', 'low_fats':'category', 'recyclable':'category'})\"], \"postgresql\": [\"Create table If Not Exists Products (product_id int, low_fats VARCHAR(30) CHECK (low_fats IN ('Y', 'N')), recyclable VARCHAR(30) CHECK (recyclable IN ('Y','N')))\\n\"], \"database_schema\": {\"Products\": {\"product_id\": \"INT\", \"low_fats\": \"ENUM('Y', 'N')\", \"recyclable\": \"ENUM('Y', 'N')\"}}}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
@@ -67,7 +86,7 @@
|
||||
"enableRunCode": true,
|
||||
"enableTestMode": false,
|
||||
"enableDebugger": false,
|
||||
"envInfo": "{\"mysql\": [\"MySQL\", \"<p><code>MySQL 8.0</code>.</p>\"], \"mssql\": [\"MS SQL Server\", \"<p><code>mssql server 2019</code>.</p>\"], \"oraclesql\": [\"Oracle\", \"<p><code>Oracle Sql 11.2</code>.</p>\"]}",
|
||||
"envInfo": "{\"mysql\": [\"MySQL\", \"<p><code>MySQL 8.0</code>.</p>\"], \"mssql\": [\"MS SQL Server\", \"<p><code>mssql server 2019</code>.</p>\"], \"oraclesql\": [\"Oracle\", \"<p><code>Oracle Sql 11.2</code>.</p>\"], \"pythondata\": [\"Pandas\", \"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0</p>\"], \"postgresql\": [\"PostgreSQL\", \"<p>PostgreSQL 16</p>\"]}",
|
||||
"libraryUrl": null,
|
||||
"adminUrl": null,
|
||||
"challengeQuestion": null,
|
||||
|
Reference in New Issue
Block a user