mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
update
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "3549",
|
||||
"questionFrontendId": "3236",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2861886,
|
||||
"title": "CEO Subordinate Hierarchy",
|
||||
"titleSlug": "ceo-subordinate-hierarchy",
|
||||
"content": null,
|
||||
"translatedTitle": "首席执行官下属层级",
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Hard",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": null,
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": "数据库",
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"45\", \"totalSubmission\": \"57\", \"totalAcceptedRaw\": 45, \"totalSubmissionRaw\": 57, \"acRate\": \"78.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Employees\":[\"employee_id\",\"employee_name\",\"manager_id\",\"salary\"]},\"rows\":{\"Employees\":[[1,\"Alice\",null,150000],[2,\"Bob\",1,120000],[3,\"Charlie\",1,110000],[4,\"David\",2,105000],[5,\"Eve\",2,100000],[6,\"Frank\",3,95000],[7,\"Grace\",3,98000],[8,\"Helen\",5,90000]]}}",
|
||||
"metaData": "{\"mysql\":[\"Create table if not exists employees(employee_id int, employee_name varchar(100), manager_id int, salary int)\"],\"mssql\":[\"Create table employees(employee_id int, employee_name varchar(100), manager_id int, salary int)\"],\"oraclesql\":[\"Create table employees(employee_id NUMBER, employee_name varchar2(100), manager_id NUMBER, salary NUMBER)\"],\"database\":true,\"name\":\"find_subordinates\",\"manual\":false,\"postgresql\":[\"CREATE TABLE IF NOT EXISTS employees (\\n employee_id INT,\\n employee_name VARCHAR(100),\\n manager_id INT,\\n salary INT\\n);\\n\"],\"pythondata\":[\"Employees = pd.DataFrame(columns=['employee_id', 'employee_name', 'manager_id', 'salary']).astype({\\n 'employee_id': pd.Int64Dtype(),\\n 'employee_name': 'str',\\n 'manager_id': pd.Int64Dtype(),\\n 'salary': pd.Int64Dtype()\\n})\"],\"database_schema\":{\"employees\":{\"employee_id\":\"INT\",\"employee_name\":\"VARCHAR(100)\",\"manager_id\":\"INT\",\"salary\":\"INT\"}}}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table if not exists employees(employee_id int, employee_name varchar(100), manager_id int, salary int)",
|
||||
"Truncate table Employees",
|
||||
"insert into Employees (employee_id, employee_name, manager_id, salary) values ('1', 'Alice', 'None', '150000')",
|
||||
"insert into Employees (employee_id, employee_name, manager_id, salary) values ('2', 'Bob', '1', '120000')",
|
||||
"insert into Employees (employee_id, employee_name, manager_id, salary) values ('3', 'Charlie', '1', '110000')",
|
||||
"insert into Employees (employee_id, employee_name, manager_id, salary) values ('4', 'David', '2', '105000')",
|
||||
"insert into Employees (employee_id, employee_name, manager_id, salary) values ('5', 'Eve', '2', '100000')",
|
||||
"insert into Employees (employee_id, employee_name, manager_id, salary) values ('6', 'Frank', '3', '95000')",
|
||||
"insert into Employees (employee_id, employee_name, manager_id, salary) values ('7', 'Grace', '3', '98000')",
|
||||
"insert into Employees (employee_id, employee_name, manager_id, salary) values ('8', 'Helen', '5', '90000')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"Employees\":[\"employee_id\",\"employee_name\",\"manager_id\",\"salary\"]},\"rows\":{\"Employees\":[[1,\"Alice\",null,150000],[2,\"Bob\",1,120000],[3,\"Charlie\",1,110000],[4,\"David\",2,105000],[5,\"Eve\",2,100000],[6,\"Frank\",3,95000],[7,\"Grace\",3,98000],[8,\"Helen\",5,90000]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "3539",
|
||||
"questionFrontendId": "3230",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2852426,
|
||||
"title": "Customer Purchasing Behavior Analysis",
|
||||
"titleSlug": "customer-purchasing-behavior-analysis",
|
||||
"content": null,
|
||||
"translatedTitle": "客户购买行为分析",
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": null,
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": "数据库",
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"55\", \"totalSubmission\": \"162\", \"totalAcceptedRaw\": 55, \"totalSubmissionRaw\": 162, \"acRate\": \"34.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Transactions\":[\"transaction_id\",\"customer_id\",\"product_id\",\"transaction_date\",\"amount\"],\"Products\":[\"product_id\",\"category\",\"price\"]},\"rows\":{\"Transactions\":[[1,101,1,\"2023-01-01\",100.00],[2,101,2,\"2023-01-15\",150.00],[3,102,1,\"2023-01-01\",100.00],[4,102,3,\"2023-01-22\",200.00],[5,101,3,\"2023-02-10\",200.00]],\"Products\":[[1,\"A\",100.00],[2,\"B\",150.00],[3,\"C\",200.00]]}}",
|
||||
"metaData": "{\"mysql\":[\"CREATE TABLE if not exists Transactions (\\n transaction_id INT,\\n customer_id INT,\\n product_id INT,\\n transaction_date DATE,\\n amount DECIMAL(10, 2)\\n)\",\"CREATE TABLE if not exists Products (\\n product_id INT ,\\n category VARCHAR(255),\\n price DECIMAL(10, 2)\\n)\\n\"],\"mssql\":[\"CREATE TABLE Transactions (\\n transaction_id INT ,\\n customer_id INT,\\n product_id INT,\\n transaction_date DATE,\\n amount DECIMAL(10, 2)\\n)\\n\",\"\\nCREATE TABLE Products (\\n product_id INT ,\\n category VARCHAR(255),\\n price DECIMAL(10, 2)\\n)\"],\"oraclesql\":[\"CREATE TABLE Transactions (\\n transaction_id NUMBER ,\\n customer_id NUMBER,\\n product_id NUMBER,\\n transaction_date DATE,\\n amount NUMBER(10, 2)\\n)\",\"CREATE TABLE Products (\\n product_id NUMBER ,\\n category VARCHAR2(255),\\n price NUMBER(10, 2)\\n)\",\"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"],\"database\":true,\"name\":\"analyze_customer_behavior\",\"postgresql\":[\"CREATE TABLE IF NOT EXISTS Transactions (\\n transaction_id INTEGER,\\n customer_id INTEGER,\\n product_id INTEGER,\\n transaction_date DATE,\\n amount NUMERIC(10, 2)\\n);\\n\",\"CREATE TABLE IF NOT EXISTS Products (\\n product_id INTEGER,\\n category VARCHAR(255),\\n price NUMERIC(10, 2)\\n);\\n\"],\"pythondata\":[\"Transactions = pd.DataFrame(columns=['transaction_id', 'customer_id', 'product_id', 'transaction_date', 'amount']).astype({'transaction_id': 'int', 'customer_id': 'int', 'product_id': 'int', 'transaction_date': 'datetime64[ns]', 'amount': 'float'})\",\"Products = pd.DataFrame(columns=['product_id', 'category', 'price']).astype({'product_id': 'int', 'category': 'str', 'price': 'float'})\"],\"database_schema\":{\"Transactions\":{\"transaction_id\":\"INT\",\"customer_id\":\"INT\",\"product_id\":\"INT\",\"transaction_date\":\"DATE\",\"amount\":\"DECIMAL(10, 2)\"},\"Products\":{\"product_id\":\"INT\",\"category\":\"VARCHAR(255)\",\"price\":\"DECIMAL(10, 2)\"}}}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"CREATE TABLE if not exists Transactions (\n transaction_id INT,\n customer_id INT,\n product_id INT,\n transaction_date DATE,\n amount DECIMAL(10, 2)\n)",
|
||||
"CREATE TABLE if not exists Products (\n product_id INT ,\n category VARCHAR(255),\n price DECIMAL(10, 2)\n)\n",
|
||||
"Truncate table Transactions",
|
||||
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('1', '101', '1', '2023-01-01', '100.0')",
|
||||
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('2', '101', '2', '2023-01-15', '150.0')",
|
||||
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('3', '102', '1', '2023-01-01', '100.0')",
|
||||
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('4', '102', '3', '2023-01-22', '200.0')",
|
||||
"insert into Transactions (transaction_id, customer_id, product_id, transaction_date, amount) values ('5', '101', '3', '2023-02-10', '200.0')",
|
||||
"Truncate table Products",
|
||||
"insert into Products (product_id, category, price) values ('1', 'A', '100.0')",
|
||||
"insert into Products (product_id, category, price) values ('2', 'B', '150.0')",
|
||||
"insert into Products (product_id, category, price) values ('3', 'C', '200.0')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"Transactions\":[\"transaction_id\",\"customer_id\",\"product_id\",\"transaction_date\",\"amount\"],\"Products\":[\"product_id\",\"category\",\"price\"]},\"rows\":{\"Transactions\":[[1,101,1,\"2023-01-01\",100.00],[2,101,2,\"2023-01-15\",150.00],[3,102,1,\"2023-01-01\",100.00],[4,102,3,\"2023-01-22\",200.00],[5,101,3,\"2023-02-10\",200.00]],\"Products\":[[1,\"A\",100.00],[2,\"B\",150.00],[3,\"C\",200.00]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "3554",
|
||||
"questionFrontendId": "3246",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2869459,
|
||||
"title": "Premier League Table Ranking",
|
||||
"titleSlug": "premier-league-table-ranking",
|
||||
"content": null,
|
||||
"translatedTitle": "英超积分榜排名",
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": null,
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": "数据库",
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"32\", \"totalSubmission\": \"35\", \"totalAcceptedRaw\": 32, \"totalSubmissionRaw\": 35, \"acRate\": \"91.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"TeamStats\":[\"team_id\",\"team_name\",\"matches_played\",\"wins\",\"draws\",\"losses\"]},\"rows\":{\"TeamStats\":[[1,\"Manchester City\",10,6,2,2],[2,\"Liverpool\",10,6,2,2],[3,\"Chelsea\",10,5,3,2],[4,\"Arsenal\",10,4,4,2],[5,\"Tottenham\",10,3,5,2]]}}",
|
||||
"metaData": "{\"mysql\":[\"Create table if not exists TeamStats( team_id int, team_name varchar(100),matches_played int, wins int,draws int,losses int)\"],\"mssql\":[\"Create table TeamStats( team_id int, team_name varchar(100),matches_played int, wins int,draws int,losses int)\"],\"oraclesql\":[\"Create table TeamStats( team_id NUMBER, team_name varchar2(100),matches_played NUMBER, wins NUMBER,draws NUMBER,losses NUMBER)\"],\"database\":true,\"name\":\"calculate_team_standings\",\"postgresql\":[\"CREATE TABLE IF NOT EXISTS TeamStats (\\n team_id INT,\\n team_name VARCHAR(100),\\n matches_played INT,\\n wins INT,\\n draws INT,\\n losses INT\\n);\\n\"],\"pythondata\":[\"TeamStats = pd.DataFrame(data, columns=[\\\"team_id\\\", \\\"team_name\\\", \\\"matches_played\\\", \\\"wins\\\", \\\"draws\\\", \\\"losses\\\"]).astype({\\\"team_id\\\": \\\"int\\\", \\\"team_name\\\": \\\"string\\\", \\\"matches_played\\\": \\\"int\\\", \\\"wins\\\": \\\"int\\\", \\\"draws\\\": \\\"int\\\", \\\"losses\\\": \\\"int\\\"})\\n\"],\"database_schema\":{\"TeamStats\":{\"team_id\":\"INT\",\"team_name\":\"VARCHAR(100)\",\"matches_played\":\"INT\",\"wins\":\"INT\",\"draws\":\"INT\",\"losses\":\"INT\"}}}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table if not exists TeamStats( team_id int, team_name varchar(100),matches_played int, wins int,draws int,losses int)",
|
||||
"Truncate table TeamStats",
|
||||
"insert into TeamStats (team_id, team_name, matches_played, wins, draws, losses) values ('1', 'Manchester City', '10', '6', '2', '2')",
|
||||
"insert into TeamStats (team_id, team_name, matches_played, wins, draws, losses) values ('2', 'Liverpool', '10', '6', '2', '2')",
|
||||
"insert into TeamStats (team_id, team_name, matches_played, wins, draws, losses) values ('3', 'Chelsea', '10', '5', '3', '2')",
|
||||
"insert into TeamStats (team_id, team_name, matches_played, wins, draws, losses) values ('4', 'Arsenal', '10', '4', '4', '2')",
|
||||
"insert into TeamStats (team_id, team_name, matches_played, wins, draws, losses) values ('5', 'Tottenham', '10', '3', '5', '2')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"TeamStats\":[\"team_id\",\"team_name\",\"matches_played\",\"wins\",\"draws\",\"losses\"]},\"rows\":{\"TeamStats\":[[1,\"Manchester City\",10,6,2,2],[2,\"Liverpool\",10,6,2,2],[3,\"Chelsea\",10,5,3,2],[4,\"Arsenal\",10,4,4,2],[5,\"Tottenham\",10,3,5,2]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
178
leetcode-cn/originData/alternating-groups-iii.json
Normal file
178
leetcode-cn/originData/alternating-groups-iii.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
195
leetcode-cn/originData/design-neighbor-sum-service.json
Normal file
195
leetcode-cn/originData/design-neighbor-sum-service.json
Normal file
File diff suppressed because one or more lines are too long
176
leetcode-cn/originData/find-if-digit-game-can-be-won.json
Normal file
176
leetcode-cn/originData/find-if-digit-game-can-be-won.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
183
leetcode-cn/originData/find-the-number-of-winning-players.json
Normal file
183
leetcode-cn/originData/find-the-number-of-winning-players.json
Normal file
File diff suppressed because one or more lines are too long
184
leetcode-cn/originData/find-the-winning-player-in-coin-game.json
Normal file
184
leetcode-cn/originData/find-the-winning-player-in-coin-game.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
192
leetcode-cn/originData/maximum-score-from-grid-operations.json
Normal file
192
leetcode-cn/originData/maximum-score-from-grid-operations.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
93
leetcode-cn/originData/odd-and-even-transactions.json
Normal file
93
leetcode-cn/originData/odd-and-even-transactions.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "3530",
|
||||
"questionFrontendId": "3220",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2847569,
|
||||
"title": "Odd and Even Transactions",
|
||||
"titleSlug": "odd-and-even-transactions",
|
||||
"content": "<p>Table: <code>transactions</code></p>\n\n<pre>\n+------------------+------+\n| Column Name | Type | \n+------------------+------+\n| transaction_id | int |\n| amount | int |\n| transaction_date | date |\n+------------------+------+\nThe transactions_id column uniquely identifies each row in this table.\nEach row of this table contains the transaction id, amount and transaction date.\n</pre>\n\n<p>Write a solution to find the <strong>sum of amounts</strong> for <strong>odd</strong> and <strong>even</strong> transactions for each day. If there are no odd or even transactions for a specific date, display as <code>0</code>.</p>\n\n<p>Return <em>the result table ordered by</em> <code>transaction_date</code> <em>in <strong>ascending</strong> order</em>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example:</strong></p>\n\n<div class=\"example-block\">\n<p><strong>Input:</strong></p>\n\n<p><code>transactions</code> table:</p>\n\n<pre class=\"example-io\">\n+----------------+--------+------------------+\n| transaction_id | amount | transaction_date |\n+----------------+--------+------------------+\n| 1 | 150 | 2024-07-01 |\n| 2 | 200 | 2024-07-01 |\n| 3 | 75 | 2024-07-01 |\n| 4 | 300 | 2024-07-02 |\n| 5 | 50 | 2024-07-02 |\n| 6 | 120 | 2024-07-03 |\n+----------------+--------+------------------+\n </pre>\n\n<p><strong>Output:</strong></p>\n\n<pre class=\"example-io\">\n+------------------+---------+----------+\n| transaction_date | odd_sum | even_sum |\n+------------------+---------+----------+\n| 2024-07-01 | 75 | 350 |\n| 2024-07-02 | 0 | 350 |\n| 2024-07-03 | 0 | 120 |\n+------------------+---------+----------+\n </pre>\n\n<p><strong>Explanation:</strong></p>\n\n<ul>\n\t<li>For transaction dates:\n\t<ul>\n\t\t<li>2024-07-01:\n\t\t<ul>\n\t\t\t<li>Sum of amounts for odd transactions: 75</li>\n\t\t\t<li>Sum of amounts for even transactions: 150 + 200 = 350</li>\n\t\t</ul>\n\t\t</li>\n\t\t<li>2024-07-02:\n\t\t<ul>\n\t\t\t<li>Sum of amounts for odd transactions: 0</li>\n\t\t\t<li>Sum of amounts for even transactions: 300 + 50 = 350</li>\n\t\t</ul>\n\t\t</li>\n\t\t<li>2024-07-03:\n\t\t<ul>\n\t\t\t<li>Sum of amounts for odd transactions: 0</li>\n\t\t\t<li>Sum of amounts for even transactions: 120</li>\n\t\t</ul>\n\t\t</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p><strong>Note:</strong> The output table is ordered by <code>transaction_date</code> in ascending order.</p>\n</div>\n",
|
||||
"translatedTitle": "奇数和偶数交易",
|
||||
"translatedContent": "<p>表:<code>transactions</code></p>\n\n<pre>\n+------------------+------+\n| Column Name | Type | \n+------------------+------+\n| transaction_id | int |\n| amount | int |\n| transaction_date | date |\n+------------------+------+\ntransactions_id 列唯一标识了表中的每一行。\n这张表的每一行包含交易 id,金额总和和交易日期。\n</pre>\n\n<p>编写一个解决方案来查找每天 <strong>奇数</strong> 交易金额和 <strong>偶数</strong> 交易金额的 <strong>总和</strong>。如果某天没有奇数或偶数交易,显示为 <code>0</code>。</p>\n\n<p>返回结果表以 <code>transaction_date</code> <strong>升序</strong> 排序。</p>\n\n<p>结果格式如下所示。</p>\n\n<p> </p>\n\n<p><strong class=\"example\">示例:</strong></p>\n\n<div class=\"example-block\">\n<p><b>输入:</b></p>\n\n<p><code>transactions</code> 表:</p>\n\n<pre class=\"example-io\">\n+----------------+--------+------------------+\n| transaction_id | amount | transaction_date |\n+----------------+--------+------------------+\n| 1 | 150 | 2024-07-01 |\n| 2 | 200 | 2024-07-01 |\n| 3 | 75 | 2024-07-01 |\n| 4 | 300 | 2024-07-02 |\n| 5 | 50 | 2024-07-02 |\n| 6 | 120 | 2024-07-03 |\n+----------------+--------+------------------+\n </pre>\n\n<p><strong>输出:</strong></p>\n\n<pre class=\"example-io\">\n+------------------+---------+----------+\n| transaction_date | odd_sum | even_sum |\n+------------------+---------+----------+\n| 2024-07-01 | 75 | 350 |\n| 2024-07-02 | 0 | 350 |\n| 2024-07-03 | 0 | 120 |\n+------------------+---------+----------+\n </pre>\n\n<p><strong>解释:</strong></p>\n\n<ul>\n\t<li>对于交易日期:\n\t<ul>\n\t\t<li>2024-07-01:\n\t\t<ul>\n\t\t\t<li>奇数交易金额总和:75</li>\n\t\t\t<li>偶数交易金额总和:150 + 200 = 350</li>\n\t\t</ul>\n\t\t</li>\n\t\t<li>2024-07-02:\n\t\t<ul>\n\t\t\t<li>奇数交易金额总和:0</li>\n\t\t\t<li>偶数交易金额总和:300 + 50 = 350</li>\n\t\t</ul>\n\t\t</li>\n\t\t<li>2024-07-03:\n\t\t<ul>\n\t\t\t<li>奇数交易金额总和:0</li>\n\t\t\t<li>偶数交易金额总和:120</li>\n\t\t</ul>\n\t\t</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p><b>注意:</b>输出表以 <code>transaction_date</code> 升序排序。</p>\n</div>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false, \"cangjie\": false}",
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": "数据库",
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "MySQL",
|
||||
"langSlug": "mysql",
|
||||
"code": "# Write your MySQL query statement below",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "MS SQL Server",
|
||||
"langSlug": "mssql",
|
||||
"code": "/* Write your T-SQL query statement below */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "Oracle",
|
||||
"langSlug": "oraclesql",
|
||||
"code": "/* Write your PL/SQL query statement below */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "Pandas",
|
||||
"langSlug": "pythondata",
|
||||
"code": "import pandas as pd\n\ndef sum_daily_odd_even(transactions: pd.DataFrame) -> pd.DataFrame:\n ",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "PostgreSQL",
|
||||
"langSlug": "postgresql",
|
||||
"code": "-- Write your PostgreSQL query statement below",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"408\", \"totalSubmission\": \"548\", \"totalAcceptedRaw\": 408, \"totalSubmissionRaw\": 548, \"acRate\": \"74.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"transactions\":[\"transaction_id\",\"amount\",\"transaction_date\"]},\"rows\":{\"transactions\":[[1,150,\"2024-07-01\"],[2,200,\"2024-07-01\"],[3,75,\"2024-07-01\"],[4,300,\"2024-07-02\"],[5,50,\"2024-07-02\"],[6,120,\"2024-07-03\"]]}}",
|
||||
"metaData": "{\"mysql\":[\"Create table if not exists transactions ( transaction_id int, amount int, transaction_date date)\"],\"mssql\":[\"Create table transactions ( transaction_id int, amount int, transaction_date date)\"],\"oraclesql\":[\"Create table transactions ( transaction_id int, amount int, transaction_date date)\",\"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"],\"database\":true,\"name\":\"sum_daily_odd_even\",\"postgresql\":[\"CREATE TABLE IF NOT EXISTS transactions (\\n transaction_id int,\\n amount int,\\n transaction_date date\\n);\\n\"],\"pythondata\":[\"transactions = pd.DataFrame(\\n columns=[\\\"transaction_id\\\", \\\"amount\\\", \\\"transaction_date\\\"],\\n dtype={\\n \\\"transaction_id\\\": \\\"int\\\",\\n \\\"amount\\\": \\\"int\\\",\\n \\\"transaction_date\\\": \\\"datetime64[ns]\\\",\\n },\\n)\\n\"],\"database_schema\":{\"transactions\":{\"transaction_id\":\"INT\",\"amount\":\"INT\",\"transaction_date\":\"DATE\"}}}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table if not exists transactions ( transaction_id int, amount int, transaction_date date)",
|
||||
"Truncate table transactions",
|
||||
"insert into transactions (transaction_id, amount, transaction_date) values ('1', '150', '2024-07-01')",
|
||||
"insert into transactions (transaction_id, amount, transaction_date) values ('2', '200', '2024-07-01')",
|
||||
"insert into transactions (transaction_id, amount, transaction_date) values ('3', '75', '2024-07-01')",
|
||||
"insert into transactions (transaction_id, amount, transaction_date) values ('4', '300', '2024-07-02')",
|
||||
"insert into transactions (transaction_id, amount, transaction_date) values ('5', '50', '2024-07-02')",
|
||||
"insert into transactions (transaction_id, amount, transaction_date) values ('6', '120', '2024-07-03')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"transactions\":[\"transaction_id\",\"amount\",\"transaction_date\"]},\"rows\":{\"transactions\":[[1,150,\"2024-07-01\"],[2,200,\"2024-07-01\"],[3,75,\"2024-07-01\"],[4,300,\"2024-07-02\"],[5,50,\"2024-07-02\"],[6,120,\"2024-07-03\"]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
190
leetcode-cn/originData/time-taken-to-mark-all-nodes.json
Normal file
190
leetcode-cn/originData/time-taken-to-mark-all-nodes.json
Normal file
File diff suppressed because one or more lines are too long
190
leetcode-cn/originData/vowels-game-in-a-string.json
Normal file
190
leetcode-cn/originData/vowels-game-in-a-string.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user