Fetch the repository succeeded.
{
"data": {
"question": {
"questionId": "180",
"questionFrontendId": "180",
"boundTopicId": null,
"title": "Consecutive Numbers",
"titleSlug": "consecutive-numbers",
"content": "<p>Table: <code>Logs</code></p>\n\n<pre>\n+-------------+---------+\n| Column Name | Type |\n+-------------+---------+\n| id | int |\n| num | varchar |\n+-------------+---------+\nIn SQL, id is the primary key for this table.\nid is an autoincrement column.\n</pre>\n\n<p> </p>\n\n<p>Find all numbers that appear at least three times consecutively.</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> \nLogs table:\n+----+-----+\n| id | num |\n+----+-----+\n| 1 | 1 |\n| 2 | 1 |\n| 3 | 1 |\n| 4 | 2 |\n| 5 | 1 |\n| 6 | 2 |\n| 7 | 2 |\n+----+-----+\n<strong>Output:</strong> \n+-----------------+\n| ConsecutiveNums |\n+-----------------+\n| 1 |\n+-----------------+\n<strong>Explanation:</strong> 1 is the only number that appears consecutively for at least three times.\n</pre>\n",
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 1906,
"dislikes": 250,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\": {\"Logs\": [\"id\", \"num\"]}, \"rows\": {\"Logs\": [[1, 1], [2, 1], [3, 1], [4, 2], [5, 1], [6, 2], [7, 2]]}}",
"categoryTitle": "Database",
"contributors": [],
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": null,
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": [
{
"lang": "MySQL",
"langSlug": "mysql",
"code": "# Write your MySQL query statement below\n",
"__typename": "CodeSnippetNode"
},
{
"lang": "MS SQL Server",
"langSlug": "mssql",
"code": "/* Write your T-SQL query statement below */\n",
"__typename": "CodeSnippetNode"
},
{
"lang": "Oracle",
"langSlug": "oraclesql",
"code": "/* Write your PL/SQL query statement below */\n",
"__typename": "CodeSnippetNode"
},
{
"lang": "Pandas",
"langSlug": "pythondata",
"code": "import pandas as pd\n\ndef consecutive_numbers(logs: pd.DataFrame) -> pd.DataFrame:\n ",
"__typename": "CodeSnippetNode"
},
{
"lang": "PostgreSQL",
"langSlug": "postgresql",
"code": "-- Write your PostgreSQL query statement below\n",
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"313.2K\", \"totalSubmission\": \"669K\", \"totalAcceptedRaw\": 313171, \"totalSubmissionRaw\": 668954, \"acRate\": \"46.8%\"}",
"hints": [],
"solution": {
"id": "216",
"canSeeDetail": true,
"paidOnly": false,
"hasVideoSolution": false,
"paidOnlyVideo": true,
"__typename": "ArticleNode"
},
"status": null,
"sampleTestCase": "{\"headers\": {\"Logs\": [\"id\", \"num\"]}, \"rows\": {\"Logs\": [[1, 1], [2, 1], [3, 1], [4, 2], [5, 1], [6, 2], [7, 2]]}}",
"metaData": "{\"mysql\": [\"Create table If Not Exists Logs (id int, num int)\"], \"mssql\": [\"Create table Logs (id int, num int)\"], \"oraclesql\": [\"Create table Logs (id int, num int)\"], \"database\": true, \"name\": \"consecutive_numbers\", \"pythondata\": [\"Logs = pd.DataFrame([], columns=['id', 'num']).astype({'id':'Int64', 'num':'Int64'})\"], \"postgresql\": [\"Create table If Not Exists Logs (id int, num int)\"], \"database_schema\": {\"Logs\": {\"id\": \"INT\", \"num\": \"INT\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"Create table If Not Exists Logs (id int, num int)",
"Truncate table Logs",
"insert into Logs (id, num) values ('1', '1')",
"insert into Logs (id, num) values ('2', '1')",
"insert into Logs (id, num) values ('3', '1')",
"insert into Logs (id, num) values ('4', '2')",
"insert into Logs (id, num) values ('5', '1')",
"insert into Logs (id, num) values ('6', '2')",
"insert into Logs (id, num) values ('7', '2')"
],
"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>\"], \"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,
"__typename": "QuestionNode"
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。