1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-04 23:11:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -6,13 +6,13 @@
"boundTopicId": null,
"title": "Exchange Seats",
"titleSlug": "exchange-seats",
"content": "<p>Table: <code>Seat</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| name | varchar |\n+-------------+---------+\nid is the primary key column for this table.\nEach row of this table indicates the name and the ID of a student.\nid is a continuous increment.\n</pre>\n\n<p>&nbsp;</p>\n\n<p>Write an SQL query to swap the seat id of every two consecutive students. If the number of students is odd, the id of the last student is not swapped.</p>\n\n<p>Return the result table ordered by <code>id</code> <strong>in ascending order</strong>.</p>\n\n<p>The query result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nSeat table:\n+----+---------+\n| id | student |\n+----+---------+\n| 1 | Abbot |\n| 2 | Doris |\n| 3 | Emerson |\n| 4 | Green |\n| 5 | Jeames |\n+----+---------+\n<strong>Output:</strong> \n+----+---------+\n| id | student |\n+----+---------+\n| 1 | Doris |\n| 2 | Abbot |\n| 3 | Green |\n| 4 | Emerson |\n| 5 | Jeames |\n+----+---------+\n<strong>Explanation:</strong> \nNote that if the number of students is odd, there is no need to change the last one&#39;s seat.\n</pre>\n",
"content": "<p>Table: <code>Seat</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| student | varchar |\n+-------------+---------+\nid is the primary key (unique value) column for this table.\nEach row of this table indicates the name and the ID of a student.\nid is a continuous increment.\n</pre>\n\n<p>&nbsp;</p>\n\n<p>Write a solution to swap the seat id of every two consecutive students. If the number of students is odd, the id of the last student is not swapped.</p>\n\n<p>Return the result table ordered by <code>id</code> <strong>in ascending order</strong>.</p>\n\n<p>The result format is in the following example.</p>\n\n<p>&nbsp;</p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \nSeat table:\n+----+---------+\n| id | student |\n+----+---------+\n| 1 | Abbot |\n| 2 | Doris |\n| 3 | Emerson |\n| 4 | Green |\n| 5 | Jeames |\n+----+---------+\n<strong>Output:</strong> \n+----+---------+\n| id | student |\n+----+---------+\n| 1 | Doris |\n| 2 | Abbot |\n| 3 | Green |\n| 4 | Emerson |\n| 5 | Jeames |\n+----+---------+\n<strong>Explanation:</strong> \nNote that if the number of students is odd, there is no need to change the last one&#39;s seat.\n</pre>\n",
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 656,
"dislikes": 354,
"likes": 1262,
"dislikes": 563,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\": {\"Seat\": [\"id\",\"student\"]}, \"rows\": {\"Seat\": [[1,\"Abbot\"],[2,\"Doris\"],[3,\"Emerson\"],[4,\"Green\"],[5,\"Jeames\"]]}}",
@@ -45,21 +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 exchange_seats(seat: pd.DataFrame) -> pd.DataFrame:\n ",
"__typename": "CodeSnippetNode"
},
{
"lang": "PostgreSQL",
"langSlug": "postgresql",
"code": "-- Write your PostgreSQL query statement below\n",
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"100.5K\", \"totalSubmission\": \"145.2K\", \"totalAcceptedRaw\": 100517, \"totalSubmissionRaw\": 145181, \"acRate\": \"69.2%\"}",
"stats": "{\"totalAccepted\": \"170.9K\", \"totalSubmission\": \"249.4K\", \"totalAcceptedRaw\": 170920, \"totalSubmissionRaw\": 249423, \"acRate\": \"68.5%\"}",
"hints": [],
"solution": {
"id": "195",
"canSeeDetail": true,
"paidOnly": false,
"canSeeDetail": false,
"paidOnly": true,
"hasVideoSolution": false,
"paidOnlyVideo": true,
"__typename": "ArticleNode"
},
"status": null,
"sampleTestCase": "{\"headers\": {\"Seat\": [\"id\",\"student\"]}, \"rows\": {\"Seat\": [[1,\"Abbot\"],[2,\"Doris\"],[3,\"Emerson\"],[4,\"Green\"],[5,\"Jeames\"]]}}",
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Seat (id int, student varchar(255))\"\n ],\n \"mssql\": [\n \"Create table Seat (id int, student varchar(255))\"\n ],\n \"oraclesql\": [\n \"Create table Seat (id int, student varchar(255))\"\n ],\n \"database\": true\n}",
"metaData": "{\"mysql\": [\"Create table If Not Exists Seat (id int, student varchar(255))\"], \"mssql\": [\"Create table Seat (id int, student varchar(255))\"], \"oraclesql\": [\"Create table Seat (id int, student varchar(255))\"], \"database\": true, \"name\": \"exchange_seats\", \"pythondata\": [\"Seat = pd.DataFrame([], columns=['id', 'student']).astype({'id':'Int64', 'student':'object'})\"], \"postgresql\": [\"\\nCreate table If Not Exists Seat (id int, student varchar(255))\"], \"database_schema\": {\"Seat\": {\"id\": \"INT\", \"student\": \"VARCHAR(255)\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
@@ -74,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,