1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-03 22:42:52 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
zhangbk1
2024-06-25 09:35:00 +08:00
parent b545ef1222
commit b1fc2c627d
91 changed files with 19753 additions and 9211 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,59 @@
{
"data": {
"question": {
"questionId": "3473",
"questionFrontendId": "3166",
"boundTopicId": null,
"title": "Calculate Parking Fees and Duration",
"titleSlug": "calculate-parking-fees-and-duration",
"content": null,
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 4,
"dislikes": 1,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"ParkingTransactions\":[\"lot_id\",\"car_id\",\"entry_time\",\"exit_time\",\"fee_paid\"]},\"rows\":{\"ParkingTransactions\":[[1,1001,\"2023-06-01 08:00:00\",\"2023-06-01 10:30:00\",5.00],[1,1001,\"2023-06-02 11:00:00\",\"2023-06-02 12:45:00\",3.00],[2,1001,\"2023-06-01 10:45:00\",\"2023-06-01 12:00:00\",6.00],[2,1002,\"2023-06-01 09:00:00\",\"2023-06-01 11:30:00\",4.00],[3,1001,\"2023-06-03 07:00:00\",\"2023-06-03 09:00:00\",4.00],[3,1002,\"2023-06-02 12:00:00\",\"2023-06-02 14:00:00\",2.00]]}}",
"categoryTitle": "Database",
"contributors": [],
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": null,
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"377\", \"totalSubmission\": \"631\", \"totalAcceptedRaw\": 377, \"totalSubmissionRaw\": 631, \"acRate\": \"59.7%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"ParkingTransactions\":[\"lot_id\",\"car_id\",\"entry_time\",\"exit_time\",\"fee_paid\"]},\"rows\":{\"ParkingTransactions\":[[1,1001,\"2023-06-01 08:00:00\",\"2023-06-01 10:30:00\",5.00],[1,1001,\"2023-06-02 11:00:00\",\"2023-06-02 12:45:00\",3.00],[2,1001,\"2023-06-01 10:45:00\",\"2023-06-01 12:00:00\",6.00],[2,1002,\"2023-06-01 09:00:00\",\"2023-06-01 11:30:00\",4.00],[3,1001,\"2023-06-03 07:00:00\",\"2023-06-03 09:00:00\",4.00],[3,1002,\"2023-06-02 12:00:00\",\"2023-06-02 14:00:00\",2.00]]}}",
"metaData": "{\"mysql\": [\"CREATE TABLE If not exists ParkingTransactions (\\n lot_id INT,\\n car_id INT,\\n entry_time DATETIME,\\n exit_time DATETIME,\\n fee_paid DECIMAL(10, 2)\\n)\\n\"], \"mssql\": [\"CREATE TABLE ParkingTransactions (\\n lot_id INT,\\n car_id INT,\\n entry_time DATETIME,\\n exit_time DATETIME,\\n fee_paid DECIMAL(10, 2)\\n);\\n\"], \"oraclesql\": [\"CREATE TABLE ParkingTransactions (\\n lot_id NUMBER,\\n car_id NUMBER,\\n entry_time DATE,\\n exit_time DATE,\\n fee_paid NUMBER(10, 2)\\n)\\n\", \"ALTER SESSION SET nls_date_format='YYYY-MM-DD HH24:MI:SS'\"], \"database\": true, \"name\": \"calculate_fees_and_duration\", \"postgresql\": [\"CREATE TABLE IF NOT EXISTS ParkingTransactions (\\n lot_id INTEGER,\\n car_id INTEGER,\\n entry_time TIMESTAMP,\\n exit_time TIMESTAMP,\\n fee_paid NUMERIC(10, 2)\\n);\"], \"pythondata\": [\"ParkingTransactions = pd.DataFrame([], columns=['lot_id', 'car_id', 'entry_time', 'exit_time', 'fee_paid']).astype({\\n 'lot_id': 'Int64',\\n 'car_id': 'Int64',\\n 'entry_time': 'datetime64[ns]',\\n 'exit_time': 'datetime64[ns]',\\n 'fee_paid': 'float64'\\n})\"], \"database_schema\": {\"ParkingTransactions\": {\"lot_id\": \"INT\", \"car_id\": \"INT\", \"entry_time\": \"DATETIME\", \"exit_time\": \"DATETIME\", \"fee_paid\": \"DECIMAL(10, 2)\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"CREATE TABLE If not exists ParkingTransactions (\n lot_id INT,\n car_id INT,\n entry_time DATETIME,\n exit_time DATETIME,\n fee_paid DECIMAL(10, 2)\n)\n",
"Truncate table ParkingTransactions",
"insert into ParkingTransactions (lot_id, car_id, entry_time, exit_time, fee_paid) values ('1', '1001', '2023-06-01 08:00:00', '2023-06-01 10:30:00', '5.0')",
"insert into ParkingTransactions (lot_id, car_id, entry_time, exit_time, fee_paid) values ('1', '1001', '2023-06-02 11:00:00', '2023-06-02 12:45:00', '3.0')",
"insert into ParkingTransactions (lot_id, car_id, entry_time, exit_time, fee_paid) values ('2', '1001', '2023-06-01 10:45:00', '2023-06-01 12:00:00', '6.0')",
"insert into ParkingTransactions (lot_id, car_id, entry_time, exit_time, fee_paid) values ('2', '1002', '2023-06-01 09:00:00', '2023-06-01 11:30:00', '4.0')",
"insert into ParkingTransactions (lot_id, car_id, entry_time, exit_time, fee_paid) values ('3', '1001', '2023-06-03 07:00:00', '2023-06-03 09:00:00', '4.0')",
"insert into ParkingTransactions (lot_id, car_id, entry_time, exit_time, fee_paid) values ('3', '1002', '2023-06-02 12:00:00', '2023-06-02 14:00:00', '2.0')"
],
"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"
}
}
}

View File

@@ -0,0 +1,58 @@
{
"data": {
"question": {
"questionId": "3448",
"questionFrontendId": "3140",
"boundTopicId": null,
"title": "Consecutive Available Seats II",
"titleSlug": "consecutive-available-seats-ii",
"content": null,
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 2,
"dislikes": 2,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"Cinema\":[\"seat_id\",\"free\"]},\"rows\":{\"Cinema\":[[1,1],[2,0],[3,1],[4,1],[5,1]]}}",
"categoryTitle": "Database",
"contributors": [],
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": null,
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"513\", \"totalSubmission\": \"807\", \"totalAcceptedRaw\": 513, \"totalSubmissionRaw\": 807, \"acRate\": \"63.6%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"Cinema\":[\"seat_id\",\"free\"]},\"rows\":{\"Cinema\":[[1,1],[2,0],[3,1],[4,1],[5,1]]}}",
"metaData": "{\"mysql\": [\"CREATE TABLE if Not exists Cinema (\\n seat_id INT PRIMARY KEY AUTO_INCREMENT,\\n free BOOLEAN\\n)\\n\"], \"mssql\": [\"Create table Cinema (seat_id int primary key, free BIT)\\n\"], \"oraclesql\": [\"CREATE TABLE Cinema (\\n seat_id INT PRIMARY KEY,\\n free NUMBER(1,0)\\n)\\n\"], \"database\": true, \"name\": \"consecutive_available_seats\", \"postgresql\": [\"CREATE TABLE Cinema (\\n seat_id INT PRIMARY KEY,\\n free INT CHECK (free IN (0, 1))\\n);\"], \"pythondata\": [\"Cinema = pd.DataFrame({'seat_id': pd.Series(dtype='int'), 'free': pd.Series(dtype='bool')})\"], \"database_schema\": {\"Cinema\": {\"seat_id\": \"INT\", \"free\": \"BOOLEAN\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"CREATE TABLE if Not exists Cinema (\n seat_id INT PRIMARY KEY AUTO_INCREMENT,\n free BOOLEAN\n)\n",
"Truncate table Cinema",
"insert into Cinema (seat_id, free) values ('1', '1')",
"insert into Cinema (seat_id, free) values ('2', '0')",
"insert into Cinema (seat_id, free) values ('3', '1')",
"insert into Cinema (seat_id, free) values ('4', '1')",
"insert into Cinema (seat_id, free) values ('5', '1')"
],
"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"
}
}
}

View File

@@ -0,0 +1,55 @@
{
"data": {
"question": {
"questionId": "3505",
"questionFrontendId": "3198",
"boundTopicId": null,
"title": "Find Cities in Each State",
"titleSlug": "find-cities-in-each-state",
"content": null,
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 0,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"cities\":[\"state\",\"city\"]},\"rows\":{\"cities\":[[\"California\",\"Los Angeles\"],[\"California\",\"San Francisco\"],[\"California\",\"San Diego\"],[\"Texas\",\"Houston\"],[\"Texas\",\"Austin\"],[\"Texas\",\"Dallas\"],[\"New York\",\"New York City\"],[\"New York\",\"Buffalo\"],[\"New York\",\"Rochester\"]]}}",
"categoryTitle": "Database",
"contributors": [],
"topicTags": [],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"58\", \"totalSubmission\": \"58\", \"totalAcceptedRaw\": 58, \"totalSubmissionRaw\": 58, \"acRate\": \"100.0%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"cities\":[\"state\",\"city\"]},\"rows\":{\"cities\":[[\"California\",\"Los Angeles\"],[\"California\",\"San Francisco\"],[\"California\",\"San Diego\"],[\"Texas\",\"Houston\"],[\"Texas\",\"Austin\"],[\"Texas\",\"Dallas\"],[\"New York\",\"New York City\"],[\"New York\",\"Buffalo\"],[\"New York\",\"Rochester\"]]}}",
"metaData": "{\"mysql\": [\"Create table if not exists cities( state varchar(100),city varchar(100))\"], \"mssql\": [\"Create table cities( state varchar(100),city varchar(100))\"], \"oraclesql\": [\"Create table cities( state varchar2(100),city varchar2(100))\"], \"database\": true, \"name\": \"find_cities\", \"postgresql\": [\"CREATE TABLE IF NOT EXISTS cities (\\n state VARCHAR(100),\\n city VARCHAR(100)\\n);\"], \"pythondata\": [\"cities = pd.DataFrame(columns=['state', 'city'])\"], \"database_schema\": {\"cities\": {\"state\": \"VARCHAR(100)\", \"city\": \"VARCHAR(100)\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"Create table if not exists cities( state varchar(100),city varchar(100))",
"Truncate table cities",
"insert into cities (state, city) values ('California', 'Los Angeles')",
"insert into cities (state, city) values ('California', 'San Francisco')",
"insert into cities (state, city) values ('California', 'San Diego')",
"insert into cities (state, city) values ('Texas', 'Houston')",
"insert into cities (state, city) values ('Texas', 'Austin')",
"insert into cities (state, city) values ('Texas', 'Dallas')",
"insert into cities (state, city) values ('New York', 'New York City')",
"insert into cities (state, city) values ('New York', 'Buffalo')",
"insert into cities (state, city) values ('New York', 'Rochester')"
],
"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"
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,81 @@
{
"data": {
"question": {
"questionId": "3503",
"questionFrontendId": "3188",
"boundTopicId": null,
"title": "Find Top Scoring Students II",
"titleSlug": "find-top-scoring-students-ii",
"content": null,
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Hard",
"likes": 4,
"dislikes": 2,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"students\":[\"student_id\",\"name\",\"major\"],\"courses\":[\"course_id\",\"name\",\"credits\",\"major\",\"mandatory\"],\"enrollments\":[\"student_id\",\"course_id\",\"semester\",\"grade\",\"GPA\"]},\"rows\":{\"students\":[[1,\"Alice\",\"Computer Science\"],[2,\"Bob\",\"Computer Science\"],[3,\"Charlie\",\"Mathematics\"],[4,\"David\",\"Mathematics\"]],\"courses\":[[101,\"Algorithms\",3,\"Computer Science\",\"Yes\"],[102,\"Data Structures\",3,\"Computer Science\",\"Yes\"],[103,\"Calculus\",4,\"Mathematics\",\"Yes\"],[104,\"Linear Algebra\",4,\"Mathematics\",\"Yes\"],[105,\"Machine Learning\",3,\"Computer Science\",\"No\"],[106,\"Probability\",3,\"Mathematics\",\"No\"],[107,\"Operating Systems\",3,\"Computer Science\",\"No\"],[108,\"Statistics\",3,\"Mathematics\",\"No\"]],\"enrollments\":[[1,101,\"Fall 2023\",\"A\",4.0],[1,102,\"Spring 2023\",\"A\",4.0],[1,105,\"Spring 2023\",\"A\",4.0],[1,107,\"Fall 2023\",\"B\",3.5],[2,101,\"Fall 2023\",\"A\",4.0],[2,102,\"Spring 2023\",\"B\",3.0],[3,103,\"Fall 2023\",\"A\",4.0],[3,104,\"Spring 2023\",\"A\",4.0],[3,106,\"Spring 2023\",\"A\",4.0],[3,108,\"Fall 2023\",\"B\",3.5],[4,103,\"Fall 2023\",\"B\",3.0],[4,104,\"Spring 2023\",\"B\",3.0]]}}",
"categoryTitle": "Database",
"contributors": [],
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": null,
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"180\", \"totalSubmission\": \"327\", \"totalAcceptedRaw\": 180, \"totalSubmissionRaw\": 327, \"acRate\": \"55.0%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"students\":[\"student_id\",\"name\",\"major\"],\"courses\":[\"course_id\",\"name\",\"credits\",\"major\",\"mandatory\"],\"enrollments\":[\"student_id\",\"course_id\",\"semester\",\"grade\",\"GPA\"]},\"rows\":{\"students\":[[1,\"Alice\",\"Computer Science\"],[2,\"Bob\",\"Computer Science\"],[3,\"Charlie\",\"Mathematics\"],[4,\"David\",\"Mathematics\"]],\"courses\":[[101,\"Algorithms\",3,\"Computer Science\",\"Yes\"],[102,\"Data Structures\",3,\"Computer Science\",\"Yes\"],[103,\"Calculus\",4,\"Mathematics\",\"Yes\"],[104,\"Linear Algebra\",4,\"Mathematics\",\"Yes\"],[105,\"Machine Learning\",3,\"Computer Science\",\"No\"],[106,\"Probability\",3,\"Mathematics\",\"No\"],[107,\"Operating Systems\",3,\"Computer Science\",\"No\"],[108,\"Statistics\",3,\"Mathematics\",\"No\"]],\"enrollments\":[[1,101,\"Fall 2023\",\"A\",4.0],[1,102,\"Spring 2023\",\"A\",4.0],[1,105,\"Spring 2023\",\"A\",4.0],[1,107,\"Fall 2023\",\"B\",3.5],[2,101,\"Fall 2023\",\"A\",4.0],[2,102,\"Spring 2023\",\"B\",3.0],[3,103,\"Fall 2023\",\"A\",4.0],[3,104,\"Spring 2023\",\"A\",4.0],[3,106,\"Spring 2023\",\"A\",4.0],[3,108,\"Fall 2023\",\"B\",3.5],[4,103,\"Fall 2023\",\"B\",3.0],[4,104,\"Spring 2023\",\"B\",3.0]]}}",
"metaData": "{\"mysql\": [\"CREATE TABLE if not exists students (\\n student_id INT ,\\n name VARCHAR(255),\\n major VARCHAR(255)\\n)\", \"CREATE TABLE if not exists courses (\\n course_id INT ,\\n name VARCHAR(255),\\n credits INT,\\n major VARCHAR(255),\\n mandatory ENUM('yes', 'no') DEFAULT 'no'\\n)\", \"CREATE TABLE if not exists enrollments (\\n student_id INT,\\n course_id INT,\\n semester VARCHAR(255),\\n grade VARCHAR(10),\\nGPA decimal(3,2)\\n\\n);\"], \"mssql\": [\"CREATE TABLE students (\\n student_id INT ,\\n name VARCHAR(255),\\n major VARCHAR(255)\\n)\", \"CREATE TABLE courses (\\n course_id INT PRIMARY KEY,\\n name VARCHAR(255),\\n credits INT,\\n major VARCHAR(255),\\n mandatory VARCHAR(3) CHECK (mandatory IN ('yes', 'no')) DEFAULT 'no'\\n)\", \"CREATE TABLE enrollments (\\n student_id INT,\\n course_id INT,\\n semester VARCHAR(255),\\n grade VARCHAR(1),\\n GPA DECIMAL(3,2)\\n)\"], \"oraclesql\": [\"CREATE TABLE students (\\n student_id NUMBER ,\\n name VARCHAR2(255),\\n major VARCHAR2(255)\\n)\", \"CREATE TABLE courses (\\n course_id NUMBER ,\\n name VARCHAR2(255),\\n credits NUMBER,\\n major VARCHAR2(255),\\n mandatory VARCHAR2(3) CHECK (mandatory IN ('Yes', 'No')) \\n)\", \"CREATE TABLE enrollments (\\n student_id NUMBER,\\n course_id NUMBER,\\n semester VARCHAR2(255),\\n grade VARCHAR2(1),\\n GPA Number (3,2)\\n)\"], \"database\": true, \"name\": \"find_top_scoring_students\", \"pythondata\": [\"students = pd.DataFrame([], columns=['student_id', 'name', 'major']).astype({\\n 'student_id': 'Int64', # Nullable integer type for student_id\\n 'name': 'string', # String type for names\\n 'major': 'string' # String type for majors\\n})\", \"courses = pd.DataFrame([], columns=['course_id', 'name', 'credits', 'major', 'mandatory']).astype({'course_id': 'Int64', 'name': 'string', 'credits': 'Int64', 'major': 'string', 'mandatory': 'string'})\\n\\n # pd.CategoricalDtype(categories=['yes', 'no'])\\n\", \"enrollments = pd.DataFrame([], columns=['student_id', 'course_id', 'semester', 'grade', 'GPA']).astype({'student_id': 'Int64', 'course_id': 'Int64', 'semester': 'string', 'grade': 'string', 'GPA': 'float'})\\n\"], \"postgresql\": [\"CREATE TABLE IF NOT EXISTS students (\\n student_id SERIAL,\\n name VARCHAR(255),\\n major VARCHAR(255)\\n);\", \"CREATE TABLE courses (\\n course_id INTEGER, -- or SERIAL if you want auto-increment\\n name VARCHAR(255),\\n credits INTEGER, -- or NUMERIC if you need decimal places\\n major VARCHAR(255),\\n mandatory VARCHAR(3) CHECK (mandatory IN ('Yes', 'No'))\\n);\\n\", \"CREATE TABLE IF NOT EXISTS enrollments (\\n student_id INT,\\n course_id INT,\\n semester VARCHAR(255),\\n grade VARCHAR(10),\\n GPA NUMERIC(3,2)\\n);\\n\"], \"database_schema\": {\"students\": {\"student_id\": \"INT\", \"name\": \"VARCHAR(255)\", \"major\": \"VARCHAR(255)\"}, \"courses\": {\"course_id\": \"INT\", \"name\": \"VARCHAR(255)\", \"credits\": \"INT\", \"major\": \"VARCHAR(255)\", \"mandatory\": \"ENUM('yes', 'no')\"}, \"enrollments\": {\"student_id\": \"INT\", \"course_id\": \"INT\", \"semester\": \"VARCHAR(255)\", \"grade\": \"VARCHAR(10)\", \"GPA\": \"DECIMAL(3, 2)\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"CREATE TABLE if not exists students (\n student_id INT ,\n name VARCHAR(255),\n major VARCHAR(255)\n)",
"CREATE TABLE if not exists courses (\n course_id INT ,\n name VARCHAR(255),\n credits INT,\n major VARCHAR(255),\n mandatory ENUM('yes', 'no') DEFAULT 'no'\n)",
"CREATE TABLE if not exists enrollments (\n student_id INT,\n course_id INT,\n semester VARCHAR(255),\n grade VARCHAR(10),\nGPA decimal(3,2)\n\n);",
"Truncate table students",
"insert into students (student_id, name, major) values ('1', 'Alice', 'Computer Science')",
"insert into students (student_id, name, major) values ('2', 'Bob', 'Computer Science')",
"insert into students (student_id, name, major) values ('3', 'Charlie', 'Mathematics')",
"insert into students (student_id, name, major) values ('4', 'David', 'Mathematics')",
"Truncate table courses",
"insert into courses (course_id, name, credits, major, mandatory) values ('101', 'Algorithms', '3', 'Computer Science', 'Yes')",
"insert into courses (course_id, name, credits, major, mandatory) values ('102', 'Data Structures', '3', 'Computer Science', 'Yes')",
"insert into courses (course_id, name, credits, major, mandatory) values ('103', 'Calculus', '4', 'Mathematics', 'Yes')",
"insert into courses (course_id, name, credits, major, mandatory) values ('104', 'Linear Algebra', '4', 'Mathematics', 'Yes')",
"insert into courses (course_id, name, credits, major, mandatory) values ('105', 'Machine Learning', '3', 'Computer Science', 'No')",
"insert into courses (course_id, name, credits, major, mandatory) values ('106', 'Probability', '3', 'Mathematics', 'No')",
"insert into courses (course_id, name, credits, major, mandatory) values ('107', 'Operating Systems', '3', 'Computer Science', 'No')",
"insert into courses (course_id, name, credits, major, mandatory) values ('108', 'Statistics', '3', 'Mathematics', 'No')",
"Truncate table enrollments",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('1', '101', 'Fall 2023', 'A', '4.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('1', '102', 'Spring 2023', 'A', '4.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('1', '105', 'Spring 2023', 'A', '4.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('1', '107', 'Fall 2023', 'B', '3.5')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('2', '101', 'Fall 2023', 'A', '4.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('2', '102', 'Spring 2023', 'B', '3.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('3', '103', 'Fall 2023', 'A', '4.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('3', '104', 'Spring 2023', 'A', '4.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('3', '106', 'Spring 2023', 'A', '4.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('3', '108', 'Fall 2023', 'B', '3.5')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('4', '103', 'Fall 2023', 'B', '3.0')",
"insert into enrollments (student_id, course_id, semester, grade, GPA) values ('4', '104', 'Spring 2023', 'B', '3.0')"
],
"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"
}
}
}

View File

@@ -0,0 +1,73 @@
{
"data": {
"question": {
"questionId": "3488",
"questionFrontendId": "3182",
"boundTopicId": null,
"title": "Find Top Scoring Students",
"titleSlug": "find-top-scoring-students",
"content": null,
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 4,
"dislikes": 2,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"students\":[\"student_id\",\"name\",\"major\"],\"courses\":[\"course_id\",\"name\",\"credits\",\"major\"],\"enrollments\":[\"student_id\",\"course_id\",\"semester\",\"grade\"]},\"rows\":{\"students\":[[1,\"Alice\",\"Computer Science\"],[2,\"Bob\",\"Computer Science\"],[3,\"Charlie\",\"Mathematics\"],[4,\"David\",\"Mathematics\"]],\"courses\":[[101,\"Algorithms\",3,\"Computer Science\"],[102,\"Data Structures\",3,\"Computer Science\"],[103,\"Calculus\",4,\"Mathematics\"],[104,\"Linear Algebra\",4,\"Mathematics\"]],\"enrollments\":[[1,101,\"Fall 2023\",\"A\"],[1,102,\"Fall 2023\",\"A\"],[2,101,\"Fall 2023\",\"B\"],[2,102,\"Fall 2023\",\"A\"],[3,103,\"Fall 2023\",\"A\"],[3,104,\"Fall 2023\",\"A\"],[4,103,\"Fall 2023\",\"A\"],[4,104,\"Fall 2023\",\"B\"]]}}",
"categoryTitle": "Database",
"contributors": [],
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": null,
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"298\", \"totalSubmission\": \"531\", \"totalAcceptedRaw\": 298, \"totalSubmissionRaw\": 531, \"acRate\": \"56.1%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\":{\"students\":[\"student_id\",\"name\",\"major\"],\"courses\":[\"course_id\",\"name\",\"credits\",\"major\"],\"enrollments\":[\"student_id\",\"course_id\",\"semester\",\"grade\"]},\"rows\":{\"students\":[[1,\"Alice\",\"Computer Science\"],[2,\"Bob\",\"Computer Science\"],[3,\"Charlie\",\"Mathematics\"],[4,\"David\",\"Mathematics\"]],\"courses\":[[101,\"Algorithms\",3,\"Computer Science\"],[102,\"Data Structures\",3,\"Computer Science\"],[103,\"Calculus\",4,\"Mathematics\"],[104,\"Linear Algebra\",4,\"Mathematics\"]],\"enrollments\":[[1,101,\"Fall 2023\",\"A\"],[1,102,\"Fall 2023\",\"A\"],[2,101,\"Fall 2023\",\"B\"],[2,102,\"Fall 2023\",\"A\"],[3,103,\"Fall 2023\",\"A\"],[3,104,\"Fall 2023\",\"A\"],[4,103,\"Fall 2023\",\"A\"],[4,104,\"Fall 2023\",\"B\"]]}}",
"metaData": "{\"mysql\": [\"CREATE TABLE if not exists students (\\n student_id INT ,\\n name VARCHAR(255),\\n major VARCHAR(255)\\n)\", \"CREATE TABLE if not exists courses (\\n course_id INT ,\\n name VARCHAR(255),\\n credits INT,\\n major VARCHAR(255)\\n)\\n\", \"CREATE TABLE if not exists enrollments (\\n student_id INT,\\n course_id INT,\\n semester VARCHAR(255),\\n grade VARCHAR(10)\\n\\n);\"], \"mssql\": [\"CREATE TABLE students (\\n student_id INT ,\\n name VARCHAR(255),\\n major VARCHAR(255)\\n)\", \"CREATE TABLE courses (\\n course_id INT ,\\n name VARCHAR(255),\\n credits INT,\\n major VARCHAR(255)\\n)\\n\", \"CREATE TABLE enrollments (\\n student_id INT,\\n course_id INT,\\n semester VARCHAR(255),\\n grade VARCHAR(10)\\n\\n);\"], \"oraclesql\": [\"CREATE TABLE students (\\n student_id NUMBER ,\\n name VARCHAR2(255),\\n major VARCHAR2(255)\\n)\", \"CREATE TABLE courses (\\n course_id NUMBER,\\n name VARCHAR2(255),\\n credits NUMBER,\\n major VARCHAR2(255)\\n)\", \"CREATE TABLE enrollments (\\n student_id NUMBER,\\n course_id NUMBER,\\n semester VARCHAR2(255),\\n grade VARCHAR2(10) \\n \\n)\"], \"database\": true, \"name\": \"find_top_scoring_students\", \"pythondata\": [\"enrollments = pd.DataFrame([], columns=['student_id', 'course_id', 'semester', 'grade']).astype({\\n 'student_id': 'Int64', # Nullable integer type\\n 'course_id': 'Int64', # Nullable integer type\\n 'semester': 'object', # Object type for arbitrary strings\\n 'grade': 'object' # Object type for arbitrary strings\\n})\", \"students = pd.DataFrame([], columns=['student_id', 'name', 'major']).astype({\\n 'student_id': 'Int64', # Nullable integer type\\n 'name': 'object', # Object type for arbitrary strings, equivalent to VARCHAR\\n 'major': 'object' # Object type for arbitrary strings, equivalent to VARCHAR\\n})\", \"courses = pd.DataFrame([], columns=['course_id', 'name', 'credits', 'major']).astype({\\n 'course_id': 'Int64', # Nullable integer type\\n 'name': 'object', # Object type for arbitrary strings, equivalent to VARCHAR\\n 'credits': 'Int64', # Nullable integer type\\n 'major': 'object' # Object type for arbitrary strings, equivalent to VARCHAR\\n})\"], \"postgresql\": [\"CREATE TABLE IF NOT EXISTS students (\\n student_id INT,\\n name VARCHAR(255),\\n major VARCHAR(255)\\n);\\n\", \"CREATE TABLE IF NOT EXISTS courses (\\n course_id INT,\\n name VARCHAR(255),\\n credits INT,\\n major VARCHAR(255)\\n);\\n\", \"CREATE TABLE IF NOT EXISTS enrollments (\\n student_id INT,\\n course_id INT,\\n semester VARCHAR(255),\\n grade VARCHAR(10)\\n);\\n\"], \"database_schema\": {\"students\": {\"student_id\": \"INT\", \"name\": \"VARCHAR(255)\", \"major\": \"VARCHAR(255)\"}, \"courses\": {\"course_id\": \"INT\", \"name\": \"VARCHAR(255)\", \"credits\": \"INT\", \"major\": \"VARCHAR(255)\"}, \"enrollments\": {\"student_id\": \"INT\", \"course_id\": \"INT\", \"semester\": \"VARCHAR(255)\", \"grade\": \"VARCHAR(10)\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"CREATE TABLE if not exists students (\n student_id INT ,\n name VARCHAR(255),\n major VARCHAR(255)\n)",
"CREATE TABLE if not exists courses (\n course_id INT ,\n name VARCHAR(255),\n credits INT,\n major VARCHAR(255)\n)\n",
"CREATE TABLE if not exists enrollments (\n student_id INT,\n course_id INT,\n semester VARCHAR(255),\n grade VARCHAR(10)\n\n);",
"Truncate table students",
"insert into students (student_id, name, major) values ('1', 'Alice', 'Computer Science')",
"insert into students (student_id, name, major) values ('2', 'Bob', 'Computer Science')",
"insert into students (student_id, name, major) values ('3', 'Charlie', 'Mathematics')",
"insert into students (student_id, name, major) values ('4', 'David', 'Mathematics')",
"Truncate table courses",
"insert into courses (course_id, name, credits, major) values ('101', 'Algorithms', '3', 'Computer Science')",
"insert into courses (course_id, name, credits, major) values ('102', 'Data Structures', '3', 'Computer Science')",
"insert into courses (course_id, name, credits, major) values ('103', 'Calculus', '4', 'Mathematics')",
"insert into courses (course_id, name, credits, major) values ('104', 'Linear Algebra', '4', 'Mathematics')",
"Truncate table enrollments",
"insert into enrollments (student_id, course_id, semester, grade) values ('1', '101', 'Fall 2023', 'A')",
"insert into enrollments (student_id, course_id, semester, grade) values ('1', '102', 'Fall 2023', 'A')",
"insert into enrollments (student_id, course_id, semester, grade) values ('2', '101', 'Fall 2023', 'B')",
"insert into enrollments (student_id, course_id, semester, grade) values ('2', '102', 'Fall 2023', 'A')",
"insert into enrollments (student_id, course_id, semester, grade) values ('3', '103', 'Fall 2023', 'A')",
"insert into enrollments (student_id, course_id, semester, grade) values ('3', '104', 'Fall 2023', 'A')",
"insert into enrollments (student_id, course_id, semester, grade) values ('4', '103', 'Fall 2023', 'A')",
"insert into enrollments (student_id, course_id, semester, grade) values ('4', '104', 'Fall 2023', 'B')"
],
"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"
}
}
}

View File

@@ -0,0 +1,69 @@
{
"data": {
"question": {
"questionId": "3457",
"questionFrontendId": "3150",
"boundTopicId": null,
"title": "Invalid Tweets II",
"titleSlug": "invalid-tweets-ii",
"content": null,
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 4,
"dislikes": 1,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\": {\"Tweets\": [\"tweet_id\", \"content\"]}, \"rows\": {\"Tweets\": [[1, \"What an amazing meal @MaxPower @AlexJones @JohnDoe #Learning #Fitness #Love\"], [2, \"Learning something new every day @AnnaWilson #Learning #Foodie\"], [3, \"Never been happier about today's achievements @SaraJohnson @JohnDoe @AnnaWilson #Fashion\"], [4, \"Traveling, exploring, and living my best life @JaneSmith @JohnDoe @ChrisAnderson @AlexJones #WorkLife #Travel\"], [5, \"Work hard, play hard, and cherish every moment @AlexJones #Fashion #Foodie\"], [6, \"Never been happier about today's achievements @ChrisAnderson #Fashion #WorkLife\"], [7, \"So grateful for today's experiences @AnnaWilson @LisaTaylor @ChrisAnderson @MikeBrown #Fashion #HappyDay #WorkLife #Nature\"], [8, \"What an amazing meal @EmilyClark @AlexJones @MikeBrown #Fitness\"], [9, \"Learning something new every day @EmilyClark @AnnaWilson @MaxPower #Travel\"], [10, \"So grateful for today's experiences @ChrisAnderson #Nature\"], [11, \"So grateful for today's experiences @AlexJones #Art #WorkLife\"], [12, \"Learning something new every day @JaneSmith @MikeBrown #Travel\"], [13, \"What an amazing meal @EmilyClark @JohnDoe @LisaTaylor @MaxPower #Foodie #Fitness\"], [14, \"Work hard, play hard, and cherish every moment @LisaTaylor @SaraJohnson @MaxPower @ChrisAnderson #TechLife #Nature #Music\"], [15, \"What a beautiful day it is @EmilyClark @MaxPower @SaraJohnson #Fashion\"], [16, \"What a beautiful day it is @AnnaWilson @JaneSmith #Fashion #Love #TechLife\"]]}}",
"categoryTitle": "Database",
"contributors": [],
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": null,
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"734\", \"totalSubmission\": \"800\", \"totalAcceptedRaw\": 734, \"totalSubmissionRaw\": 800, \"acRate\": \"91.8%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "{\"headers\": {\"Tweets\": [\"tweet_id\", \"content\"]}, \"rows\": {\"Tweets\": [[1, \"What an amazing meal @MaxPower @AlexJones @JohnDoe #Learning #Fitness #Love\"], [2, \"Learning something new every day @AnnaWilson #Learning #Foodie\"], [3, \"Never been happier about today's achievements @SaraJohnson @JohnDoe @AnnaWilson #Fashion\"], [4, \"Traveling, exploring, and living my best life @JaneSmith @JohnDoe @ChrisAnderson @AlexJones #WorkLife #Travel\"], [5, \"Work hard, play hard, and cherish every moment @AlexJones #Fashion #Foodie\"], [6, \"Never been happier about today's achievements @ChrisAnderson #Fashion #WorkLife\"], [7, \"So grateful for today's experiences @AnnaWilson @LisaTaylor @ChrisAnderson @MikeBrown #Fashion #HappyDay #WorkLife #Nature\"], [8, \"What an amazing meal @EmilyClark @AlexJones @MikeBrown #Fitness\"], [9, \"Learning something new every day @EmilyClark @AnnaWilson @MaxPower #Travel\"], [10, \"So grateful for today's experiences @ChrisAnderson #Nature\"], [11, \"So grateful for today's experiences @AlexJones #Art #WorkLife\"], [12, \"Learning something new every day @JaneSmith @MikeBrown #Travel\"], [13, \"What an amazing meal @EmilyClark @JohnDoe @LisaTaylor @MaxPower #Foodie #Fitness\"], [14, \"Work hard, play hard, and cherish every moment @LisaTaylor @SaraJohnson @MaxPower @ChrisAnderson #TechLife #Nature #Music\"], [15, \"What a beautiful day it is @EmilyClark @MaxPower @SaraJohnson #Fashion\"], [16, \"What a beautiful day it is @AnnaWilson @JaneSmith #Fashion #Love #TechLife\"]]}}",
"metaData": "{\"mysql\": [\"Create table If Not Exists Tweets(tweet_id int, content varchar(500))\"], \"mssql\": [\"Create table Tweets(tweet_id int, content varchar(500))\"], \"oraclesql\": [\"Create table Tweets(tweet_id int, content varchar(500))\"], \"database\": true, \"name\": \"find_invalid_tweets\", \"pythondata\": [\"Tweets = pd.DataFrame([], columns=['tweet_id', 'content']).astype({'tweet_id':'Int64', 'content':'object'})\"], \"postgresql\": [\"Create table If Not Exists Tweets(tweet_id int, content varchar(500))\"], \"database_schema\": {\"Tweets\": {\"tweet_id\": \"INT\", \"content\": \"VARCHAR(500)\"}}}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"Create table If Not Exists Tweets(tweet_id int, content varchar(500))",
"Truncate table Tweets",
"insert into Tweets (tweet_id, content) values ('1', 'What an amazing meal @MaxPower @AlexJones @JohnDoe #Learning #Fitness #Love')",
"insert into Tweets (tweet_id, content) values ('2', 'Learning something new every day @AnnaWilson #Learning #Foodie')",
"insert into Tweets (tweet_id, content) values ('3', 'Never been happier about today's achievements @SaraJohnson @JohnDoe @AnnaWilson #Fashion')",
"insert into Tweets (tweet_id, content) values ('4', 'Traveling, exploring, and living my best life @JaneSmith @JohnDoe @ChrisAnderson @AlexJones #WorkLife #Travel')",
"insert into Tweets (tweet_id, content) values ('5', 'Work hard, play hard, and cherish every moment @AlexJones #Fashion #Foodie')",
"insert into Tweets (tweet_id, content) values ('6', 'Never been happier about today's achievements @ChrisAnderson #Fashion #WorkLife')",
"insert into Tweets (tweet_id, content) values ('7', 'So grateful for today's experiences @AnnaWilson @LisaTaylor @ChrisAnderson @MikeBrown #Fashion #HappyDay #WorkLife #Nature')",
"insert into Tweets (tweet_id, content) values ('8', 'What an amazing meal @EmilyClark @AlexJones @MikeBrown #Fitness')",
"insert into Tweets (tweet_id, content) values ('9', 'Learning something new every day @EmilyClark @AnnaWilson @MaxPower #Travel')",
"insert into Tweets (tweet_id, content) values ('10', 'So grateful for today's experiences @ChrisAnderson #Nature')",
"insert into Tweets (tweet_id, content) values ('11', 'So grateful for today's experiences @AlexJones #Art #WorkLife')",
"insert into Tweets (tweet_id, content) values ('12', 'Learning something new every day @JaneSmith @MikeBrown #Travel')",
"insert into Tweets (tweet_id, content) values ('13', 'What an amazing meal @EmilyClark @JohnDoe @LisaTaylor @MaxPower #Foodie #Fitness')",
"insert into Tweets (tweet_id, content) values ('14', 'Work hard, play hard, and cherish every moment @LisaTaylor @SaraJohnson @MaxPower @ChrisAnderson #TechLife #Nature #Music')",
"insert into Tweets (tweet_id, content) values ('15', 'What a beautiful day it is @EmilyClark @MaxPower @SaraJohnson #Fashion')",
"insert into Tweets (tweet_id, content) values ('16', 'What a beautiful day it is @AnnaWilson @JaneSmith #Fashion #Love #TechLife')"
],
"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"
}
}
}

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

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

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

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

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

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