1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode/originData/patients-with-a-condition.json

96 lines
7.2 KiB
JSON
Raw Normal View History

2022-03-27 18:27:43 +08:00
{
"data": {
"question": {
"questionId": "1670",
"questionFrontendId": "1527",
"boundTopicId": null,
"title": "Patients With a Condition",
"titleSlug": "patients-with-a-condition",
2023-12-09 18:42:21 +08:00
"content": "<p>Table: <code>Patients</code></p>\n\n<pre>\n+--------------+---------+\n| Column Name | Type |\n+--------------+---------+\n| patient_id | int |\n| patient_name | varchar |\n| conditions | varchar |\n+--------------+---------+\npatient_id is the primary key (column with unique values) for this table.\n&#39;conditions&#39; contains 0 or more code separated by spaces. \nThis table contains information of the patients in the hospital.\n</pre>\n\n<p>&nbsp;</p>\n\n<p>Write a solution to find the patient_id, patient_name, and conditions of the patients who have Type I Diabetes. Type I Diabetes always starts with <code>DIAB1</code> prefix.</p>\n\n<p>Return the result table in <strong>any order</strong>.</p>\n\n<p>The&nbsp;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> \nPatients table:\n+------------+--------------+--------------+\n| patient_id | patient_name | conditions |\n+------------+--------------+--------------+\n| 1 | Daniel | YFEV COUGH |\n| 2 | Alice | |\n| 3 | Bob | DIAB100 MYOP |\n| 4 | George | ACNE DIAB100 |\n| 5 | Alain | DIAB201 |\n+------------+--------------+--------------+\n<strong>Output:</strong> \n+------------+--------------+--------------+\n| patient_id | patient_name | conditions |\n+------------+--------------+--------------+\n| 3 | Bob | DIAB100 MYOP |\n| 4 | George | ACNE DIAB100 | \n+------------+--------------+--------------+\n<strong>Explanation:</strong> Bob and George both have a condition that starts with DIAB1.\n</pre>\n",
2022-03-27 18:27:43 +08:00
"translatedTitle": null,
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Easy",
2023-12-09 18:42:21 +08:00
"likes": 568,
"dislikes": 520,
2022-03-27 18:27:43 +08:00
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\": {\"Patients\": [\"patient_id\", \"patient_name\", \"conditions\"]}, \"rows\": {\"Patients\": [[1, \"Daniel\", \"YFEV COUGH\"], [2, \"Alice\", \"\"], [3, \"Bob\", \"DIAB100 MYOP\"], [4, \"George\", \"ACNE DIAB100\"], [5, \"Alain\", \"DIAB201\"]]}}",
"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"
2023-12-09 18:42:21 +08:00
},
{
"lang": "Pandas",
"langSlug": "pythondata",
"code": "import pandas as pd\n\ndef find_patients(patients: pd.DataFrame) -> pd.DataFrame:\n ",
"__typename": "CodeSnippetNode"
},
{
"lang": "PostgreSQL",
"langSlug": "postgresql",
"code": "-- Write your PostgreSQL query statement below\n",
"__typename": "CodeSnippetNode"
2022-03-27 18:27:43 +08:00
}
],
2023-12-09 19:57:46 +08:00
"stats": "{\"totalAccepted\": \"161.6K\", \"totalSubmission\": \"401.1K\", \"totalAcceptedRaw\": 161606, \"totalSubmissionRaw\": 401058, \"acRate\": \"40.3%\"}",
2022-03-27 18:27:43 +08:00
"hints": [],
2023-12-09 18:42:21 +08:00
"solution": {
"id": "2010",
"canSeeDetail": false,
"paidOnly": true,
"hasVideoSolution": false,
"paidOnlyVideo": true,
"__typename": "ArticleNode"
},
2022-03-27 18:27:43 +08:00
"status": null,
"sampleTestCase": "{\"headers\": {\"Patients\": [\"patient_id\", \"patient_name\", \"conditions\"]}, \"rows\": {\"Patients\": [[1, \"Daniel\", \"YFEV COUGH\"], [2, \"Alice\", \"\"], [3, \"Bob\", \"DIAB100 MYOP\"], [4, \"George\", \"ACNE DIAB100\"], [5, \"Alain\", \"DIAB201\"]]}}",
2023-12-09 18:42:21 +08:00
"metaData": "{\"mysql\": [\"Create table If Not Exists Patients (patient_id int, patient_name varchar(30), conditions varchar(100))\"], \"mssql\": [\"Create table Patients (patient_id int, patient_name varchar(30), conditions varchar(100))\"], \"oraclesql\": [\"Create table Patients (patient_id int, patient_name varchar(30), conditions varchar(100))\"], \"database\": true, \"name\": \"find_patients\", \"pythondata\": [\"Patients = pd.DataFrame([], columns=['patient_id', 'patient_name', 'conditions']).astype({'patient_id':'int64', 'patient_name':'object', 'conditions':'object'})\"], \"postgresql\": [\"\\nCreate table If Not Exists Patients (patient_id int, patient_name varchar(30), conditions varchar(100))\"], \"database_schema\": {\"Patients\": {\"patient_id\": \"INT\", \"patient_name\": \"VARCHAR(30)\", \"conditions\": \"VARCHAR(100)\"}}}",
2022-03-27 18:27:43 +08:00
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [
"Create table If Not Exists Patients (patient_id int, patient_name varchar(30), conditions varchar(100))",
"Truncate table Patients",
"insert into Patients (patient_id, patient_name, conditions) values ('1', 'Daniel', 'YFEV COUGH')",
"insert into Patients (patient_id, patient_name, conditions) values ('2', 'Alice', '')",
"insert into Patients (patient_id, patient_name, conditions) values ('3', 'Bob', 'DIAB100 MYOP')",
"insert into Patients (patient_id, patient_name, conditions) values ('4', 'George', 'ACNE DIAB100')",
"insert into Patients (patient_id, patient_name, conditions) values ('5', 'Alain', 'DIAB201')"
],
"enableRunCode": true,
"enableTestMode": false,
"enableDebugger": false,
2023-12-09 18:42:21 +08:00
"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>\"]}",
2022-03-27 18:27:43 +08:00
"libraryUrl": null,
"adminUrl": null,
"challengeQuestion": null,
"__typename": "QuestionNode"
}
}
}