mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
85 lines
7.8 KiB
JSON
85 lines
7.8 KiB
JSON
{
|
|
"data": {
|
|
"question": {
|
|
"questionId": "3782",
|
|
"questionFrontendId": "3436",
|
|
"categoryTitle": "Database",
|
|
"boundTopicId": 3059804,
|
|
"title": "Find Valid Emails",
|
|
"titleSlug": "find-valid-emails",
|
|
"content": "<p>Table: <code>Users</code></p>\n\n<pre>\n+-----------------+---------+\n| Column Name | Type |\n+-----------------+---------+\n| user_id | int |\n| email | varchar |\n+-----------------+---------+\n(user_id) is the unique key for this table.\nEach row contains a user's unique ID and email address.\n</pre>\n\n<p>Write a solution to find all the <strong>valid email addresses</strong>. A valid email address meets the following criteria:</p>\n\n<ul>\n\t<li>It contains exactly one <code>@</code> symbol.</li>\n\t<li>It ends with <code>.com</code>.</li>\n\t<li>The part before the <code>@</code> symbol contains only <strong>alphanumeric</strong> characters and <strong>underscores</strong>.</li>\n\t<li>The part after the <code>@</code> symbol and before <code>.com</code> contains a domain name <strong>that contains only letters</strong>.</li>\n</ul>\n\n<p>Return<em> the result table ordered by</em> <code>user_id</code> <em>in</em> <strong>ascending </strong><em>order</em>.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example:</strong></p>\n\n<div class=\"example-block\">\n<p><strong>Input:</strong></p>\n\n<p>Users table:</p>\n\n<pre class=\"example-io\">\n+---------+---------------------+\n| user_id | email |\n+---------+---------------------+\n| 1 | alice@example.com |\n| 2 | bob_at_example.com |\n| 3 | charlie@example.net |\n| 4 | david@domain.com |\n| 5 | eve@invalid |\n+---------+---------------------+\n</pre>\n\n<p><strong>Output:</strong></p>\n\n<pre class=\"example-io\">\n+---------+-------------------+\n| user_id | email |\n+---------+-------------------+\n| 1 | alice@example.com |\n| 4 | david@domain.com |\n+---------+-------------------+\n</pre>\n\n<p><strong>Explanation:</strong></p>\n\n<ul>\n\t<li><strong>alice@example.com</strong> is valid because it contains one <code>@</code>, alice is alphanumeric, and example.com starts with a letter and ends with .com.</li>\n\t<li><strong>bob_at_example.com</strong> is invalid because it contains an underscore instead of an <code>@</code>.</li>\n\t<li><strong>charlie@example.net</strong> is invalid because the domain does not end with <code>.com</code>.</li>\n\t<li><strong>david@domain.com</strong> is valid because it meets all criteria.</li>\n\t<li><strong>eve@invalid</strong> is invalid because the domain does not end with <code>.com</code>.</li>\n</ul>\n\n<p>Result table is ordered by user_id in ascending order.</p>\n</div>\n",
|
|
"translatedTitle": null,
|
|
"translatedContent": null,
|
|
"isPaidOnly": false,
|
|
"difficulty": "Easy",
|
|
"likes": 0,
|
|
"dislikes": 0,
|
|
"isLiked": null,
|
|
"similarQuestions": "[]",
|
|
"contributors": [],
|
|
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false, \"cangjie\": false}",
|
|
"topicTags": [],
|
|
"companyTagStats": null,
|
|
"codeSnippets": [
|
|
{
|
|
"lang": "MySQL",
|
|
"langSlug": "mysql",
|
|
"code": "# Write your MySQL query statement below",
|
|
"__typename": "CodeSnippetNode"
|
|
},
|
|
{
|
|
"lang": "MS SQL Server",
|
|
"langSlug": "mssql",
|
|
"code": "/* Write your T-SQL query statement below */",
|
|
"__typename": "CodeSnippetNode"
|
|
},
|
|
{
|
|
"lang": "Oracle",
|
|
"langSlug": "oraclesql",
|
|
"code": "/* Write your PL/SQL query statement below */",
|
|
"__typename": "CodeSnippetNode"
|
|
},
|
|
{
|
|
"lang": "Pandas",
|
|
"langSlug": "pythondata",
|
|
"code": "import pandas as pd\n\ndef find_valid_emails(users: pd.DataFrame) -> pd.DataFrame:\n ",
|
|
"__typename": "CodeSnippetNode"
|
|
},
|
|
{
|
|
"lang": "PostgreSQL",
|
|
"langSlug": "postgresql",
|
|
"code": "-- Write your PostgreSQL query statement below",
|
|
"__typename": "CodeSnippetNode"
|
|
}
|
|
],
|
|
"stats": "{\"totalAccepted\": \"55\", \"totalSubmission\": \"63\", \"totalAcceptedRaw\": 55, \"totalSubmissionRaw\": 63, \"acRate\": \"87.3%\"}",
|
|
"hints": [],
|
|
"solution": null,
|
|
"status": null,
|
|
"sampleTestCase": "{\"headers\":{\"Users\":[\"user_id\",\"email\"]},\"rows\":{\"Users\":[[1,\"alice@example.com\"],[2,\"bob_at_example.com\"],[3,\"charlie@example.net\"],[4,\"david@domain.com\"],[5,\"eve@invalid\"]]}}",
|
|
"metaData": "{\"mysql\":[\"CREATE TABLE If not Exists Users (\\n user_id INT,\\n email VARCHAR(255)\\n)\"],\"mssql\":[\"CREATE TABLE Users (\\n user_id INT,\\n email VARCHAR(255)\\n)\"],\"oraclesql\":[\"CREATE TABLE Users (\\n user_id NUMBER,\\n email VARCHAR2(255)\\n)\"],\"database\":true,\"name\":\"find_valid_emails\",\"postgresql\":[\"CREATE TABLE IF NOT EXISTS users (\\n user_id INT,\\n email VARCHAR(255)\\n);\\n\"],\"pythondata\":[\"Users = pd.DataFrame(columns=[\\\"user_id\\\", \\\"email\\\"]).astype({\\\"user_id\\\": \\\"int32\\\", \\\"email\\\": \\\"string\\\"})\\n\"],\"database_schema\":{\"Users\":{\"user_id\":\"INT\",\"email\":\"VARCHAR(255)\"}}}",
|
|
"judgerAvailable": true,
|
|
"judgeType": "large",
|
|
"mysqlSchemas": [
|
|
"CREATE TABLE If not Exists Users (\n user_id INT,\n email VARCHAR(255)\n)",
|
|
"Truncate table Users",
|
|
"insert into Users (user_id, email) values ('1', 'alice@example.com')",
|
|
"insert into Users (user_id, email) values ('2', 'bob_at_example.com')",
|
|
"insert into Users (user_id, email) values ('3', 'charlie@example.net')",
|
|
"insert into Users (user_id, email) values ('4', 'david@domain.com')",
|
|
"insert into Users (user_id, email) values ('5', 'eve@invalid')"
|
|
],
|
|
"enableRunCode": true,
|
|
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"],\"pythondata\":[\"Pandas\",\"<p>Python 3.10 with Pandas 2.2.2 and NumPy 1.26.4<\\/p>\"],\"postgresql\":[\"PostgreSQL\",\"<p>PostgreSQL 16<\\/p>\"]}",
|
|
"book": null,
|
|
"isSubscribed": false,
|
|
"isDailyQuestion": false,
|
|
"dailyRecordStatus": null,
|
|
"editorType": "CKEDITOR",
|
|
"ugcQuestionId": null,
|
|
"style": "LEETCODE",
|
|
"exampleTestcases": "{\"headers\":{\"Users\":[\"user_id\",\"email\"]},\"rows\":{\"Users\":[[1,\"alice@example.com\"],[2,\"bob_at_example.com\"],[3,\"charlie@example.net\"],[4,\"david@domain.com\"],[5,\"eve@invalid\"]]}}",
|
|
"__typename": "QuestionNode"
|
|
}
|
|
}
|
|
} |