1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-22 05:26:46 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2025-09-29 14:43:44 +08:00
parent 2862a227c4
commit 13f2098086
4409 changed files with 168933 additions and 166256 deletions

View File

@@ -8,17 +8,24 @@
"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&#39;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>&nbsp;</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&nbsp;is alphanumeric, and example.com&nbsp;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,
"translatedTitle": "查找合法邮箱",
"translatedContent": "<p>表:<code>Users</code></p>\n\n<pre>\n+-----------------+---------+\n| Column Name | Type |\n+-----------------+---------+\n| user_id | int |\n| email | varchar |\n+-----------------+---------+\n(user_id) 是这张表的唯一主键。\n每一行包含用户的唯一 ID 和邮箱地址。\n</pre>\n\n<p>编写一个解决方案来查找所有 <b>合法邮箱地址</b>。一个合法的邮箱地址符合下述条件:</p>\n\n<ul>\n\t<li>只包含一个&nbsp;<code>@</code>&nbsp;符号。</li>\n\t<li>以&nbsp;<code>.com</code>&nbsp;结尾。</li>\n\t<li><code>@</code>&nbsp;符号前面的部分只包含&nbsp;<strong>字母数字</strong>&nbsp;字符和&nbsp;<strong>下划线</strong>。</li>\n\t<li><code>@</code>&nbsp;符号后面与&nbsp;<code>.com</code>&nbsp;前面的部分 包含 <strong>只有字母&nbsp;</strong>的域名。</li>\n</ul>\n\n<p>返回结果表以&nbsp;<code>user_id</code> <strong>升序</strong>&nbsp;排序。</p>\n\n<p>&nbsp;</p>\n\n<p><strong class=\"example\">示例:</strong></p>\n\n<div class=\"example-block\">\n<p><strong>输入:</strong></p>\n\n<p>Users 表:</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>输出:</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>解释:</strong></p>\n\n<ul>\n\t<li><strong>alice@example.com</strong>&nbsp;是合法的因为它包含一个&nbsp;<code>@</code>alice 是只有字母数字的,并且&nbsp;example.com 以字母开始并以 .com&nbsp;结束。</li>\n\t<li><strong>bob_at_example.com</strong>&nbsp;是不合法的因为它包含下划线但没有&nbsp;<code>@</code>。</li>\n\t<li><strong>charlie@example.net</strong>&nbsp;是不合法的因为域名没有以&nbsp;<code>.com</code>&nbsp;结尾。</li>\n\t<li><strong>david@domain.com</strong>&nbsp;是合法的因为它满足所有条件。</li>\n\t<li><strong>eve@invalid</strong>&nbsp;是不合法的因为域名没有以&nbsp;<code>.com</code>&nbsp;结尾。</li>\n</ul>\n\n<p>结果表以 user_id 升序排序。</p>\n</div>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 0,
"likes": 2,
"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": [],
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python3\": false, \"python\": false, \"javascript\": false, \"typescript\": false, \"csharp\": false, \"c\": false, \"golang\": false, \"kotlin\": false, \"swift\": false, \"rust\": false, \"ruby\": false, \"php\": false, \"dart\": false, \"scala\": false, \"elixir\": false, \"erlang\": false, \"racket\": false, \"cangjie\": false, \"bash\": false, \"html\": false, \"pythonml\": false, \"react\": false, \"vanillajs\": false, \"mysql\": false, \"mssql\": false, \"postgresql\": false, \"oraclesql\": false, \"pythondata\": false}",
"topicTags": [
{
"name": "Database",
"slug": "database",
"translatedName": "数据库",
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": [
{
@@ -33,6 +40,12 @@
"code": "/* Write your T-SQL query statement below */",
"__typename": "CodeSnippetNode"
},
{
"lang": "PostgreSQL",
"langSlug": "postgresql",
"code": "-- Write your PostgreSQL query statement below",
"__typename": "CodeSnippetNode"
},
{
"lang": "Oracle",
"langSlug": "oraclesql",
@@ -44,15 +57,9 @@
"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%\"}",
"stats": "{\"totalAccepted\": \"3.1K\", \"totalSubmission\": \"5.4K\", \"totalAcceptedRaw\": 3133, \"totalSubmissionRaw\": 5428, \"acRate\": \"57.7%\"}",
"hints": [],
"solution": null,
"status": null,