mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
98 lines
8.1 KiB
JSON
98 lines
8.1 KiB
JSON
{
|
|
"data": {
|
|
"question": {
|
|
"questionId": "1664",
|
|
"questionFrontendId": "1517",
|
|
"boundTopicId": null,
|
|
"title": "Find Users With Valid E-Mails",
|
|
"titleSlug": "find-users-with-valid-e-mails",
|
|
"content": "<p>Table: <code>Users</code></p>\n\n<pre>\n+---------------+---------+\n| Column Name | Type |\n+---------------+---------+\n| user_id | int |\n| name | varchar |\n| mail | varchar |\n+---------------+---------+\nuser_id is the primary key (column with unique values) for this table.\nThis table contains information of the users signed up in a website. Some e-mails are invalid.\n</pre>\n\n<p> </p>\n\n<p>Write a solution to find the users who have <strong>valid emails</strong>.</p>\n\n<p>A valid e-mail has a prefix name and a domain where:</p>\n\n<ul>\n\t<li><strong>The prefix name</strong> is a string that may contain letters (upper or lower case), digits, underscore <code>'_'</code>, period <code>'.'</code>, and/or dash <code>'-'</code>. The prefix name <strong>must</strong> start with a letter.</li>\n\t<li><strong>The domain</strong> is <code>'@leetcode.com'</code>.</li>\n</ul>\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> \nUsers table:\n+---------+-----------+-------------------------+\n| user_id | name | mail |\n+---------+-----------+-------------------------+\n| 1 | Winston | winston@leetcode.com |\n| 2 | Jonathan | jonathanisgreat |\n| 3 | Annabelle | bella-@leetcode.com |\n| 4 | Sally | sally.come@leetcode.com |\n| 5 | Marwan | quarz#2020@leetcode.com |\n| 6 | David | david69@gmail.com |\n| 7 | Shapiro | .shapo@leetcode.com |\n+---------+-----------+-------------------------+\n<strong>Output:</strong> \n+---------+-----------+-------------------------+\n| user_id | name | mail |\n+---------+-----------+-------------------------+\n| 1 | Winston | winston@leetcode.com |\n| 3 | Annabelle | bella-@leetcode.com |\n| 4 | Sally | sally.come@leetcode.com |\n+---------+-----------+-------------------------+\n<strong>Explanation:</strong> \nThe mail of user 2 does not have a domain.\nThe mail of user 5 has the # sign which is not allowed.\nThe mail of user 6 does not have the leetcode domain.\nThe mail of user 7 starts with a period.\n</pre>\n",
|
|
"translatedTitle": null,
|
|
"translatedContent": null,
|
|
"isPaidOnly": false,
|
|
"difficulty": "Easy",
|
|
"likes": 352,
|
|
"dislikes": 219,
|
|
"isLiked": null,
|
|
"similarQuestions": "[]",
|
|
"exampleTestcases": "{\"headers\":{\"Users\":[\"user_id\",\"name\",\"mail\"]},\"rows\":{\"Users\":[[1,\"Winston\",\"winston@leetcode.com\"],[2,\"Jonathan\",\"jonathanisgreat\"],[3,\"Annabelle\",\"bella-@leetcode.com\"],[4,\"Sally\",\"sally.come@leetcode.com\"],[5,\"Marwan\",\"quarz#2020@leetcode.com\"],[6,\"David\",\"david69@gmail.com\"],[7,\"Shapiro\",\".shapo@leetcode.com\"]]}}",
|
|
"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 valid_emails(users: pd.DataFrame) -> pd.DataFrame:\n ",
|
|
"__typename": "CodeSnippetNode"
|
|
},
|
|
{
|
|
"lang": "PostgreSQL",
|
|
"langSlug": "postgresql",
|
|
"code": "-- Write your PostgreSQL query statement below\n",
|
|
"__typename": "CodeSnippetNode"
|
|
}
|
|
],
|
|
"stats": "{\"totalAccepted\": \"66.2K\", \"totalSubmission\": \"140.9K\", \"totalAcceptedRaw\": 66238, \"totalSubmissionRaw\": 140942, \"acRate\": \"47.0%\"}",
|
|
"hints": [],
|
|
"solution": {
|
|
"id": "2011",
|
|
"canSeeDetail": false,
|
|
"paidOnly": true,
|
|
"hasVideoSolution": false,
|
|
"paidOnlyVideo": true,
|
|
"__typename": "ArticleNode"
|
|
},
|
|
"status": null,
|
|
"sampleTestCase": "{\"headers\":{\"Users\":[\"user_id\",\"name\",\"mail\"]},\"rows\":{\"Users\":[[1,\"Winston\",\"winston@leetcode.com\"],[2,\"Jonathan\",\"jonathanisgreat\"],[3,\"Annabelle\",\"bella-@leetcode.com\"],[4,\"Sally\",\"sally.come@leetcode.com\"],[5,\"Marwan\",\"quarz#2020@leetcode.com\"],[6,\"David\",\"david69@gmail.com\"],[7,\"Shapiro\",\".shapo@leetcode.com\"]]}}",
|
|
"metaData": "{\"mysql\": [\"Create table If Not Exists Users (user_id int, name varchar(30), mail varchar(50))\"], \"mssql\": [\"Create table Users (user_id int, name varchar(30), mail varchar(50))\"], \"oraclesql\": [\"Create table Users (user_id int, name varchar(30), mail varchar(50))\"], \"database\": true, \"name\": \"valid_emails\", \"pythondata\": [\"Users = pd.DataFrame([], columns=['user_id', 'name', 'mail']).astype({'user_id':'int64', 'name':'object', 'mail':'object'})\"], \"postgresql\": [\"\\nCreate table If Not Exists Users (user_id int, name varchar(30), mail varchar(50))\"], \"database_schema\": {\"Users\": {\"user_id\": \"INT\", \"name\": \"VARCHAR(30)\", \"mail\": \"VARCHAR(50)\"}}}",
|
|
"judgerAvailable": true,
|
|
"judgeType": "large",
|
|
"mysqlSchemas": [
|
|
"Create table If Not Exists Users (user_id int, name varchar(30), mail varchar(50))",
|
|
"Truncate table Users",
|
|
"insert into Users (user_id, name, mail) values ('1', 'Winston', 'winston@leetcode.com')",
|
|
"insert into Users (user_id, name, mail) values ('2', 'Jonathan', 'jonathanisgreat')",
|
|
"insert into Users (user_id, name, mail) values ('3', 'Annabelle', 'bella-@leetcode.com')",
|
|
"insert into Users (user_id, name, mail) values ('4', 'Sally', 'sally.come@leetcode.com')",
|
|
"insert into Users (user_id, name, mail) values ('5', 'Marwan', 'quarz#2020@leetcode.com')",
|
|
"insert into Users (user_id, name, mail) values ('6', 'David', 'david69@gmail.com')",
|
|
"insert into Users (user_id, name, mail) values ('7', 'Shapiro', '.shapo@leetcode.com')"
|
|
],
|
|
"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"
|
|
}
|
|
}
|
|
} |