101
0/304
Loading content...
A platform trust team is auditing account emails against a strict signup policy.
Table: users
An email is considered policy-compliant when all rules hold:
Task: Return all rows from users whose mail is policy-compliant.
Output requirements:
Supported submission environments:
users:
| user_id | name | mail |
|---------|-----------|---------------------------|
| 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 |[
{"user_id":1,"name":"Winston","mail":"winston@leetcode.com"},
{"user_id":3,"name":"Annabelle","mail":"bella-@leetcode.com"},
{"user_id":4,"name":"Sally","mail":"sally.come@leetcode.com"}
]Rows 1, 3, and 4 satisfy all policy rules. Other rows fail due to missing domain, invalid characters, wrong domain, or invalid starting character.
users:
| user_id | name | mail |
|---------|---------|--------------------------|
| 10 | Asha | A_1-2.x@leetcode.com |
| 11 | Ben | 0ben@leetcode.com |
| 12 | Cia | cia@LeetCode.com |
| 13 | Dori | dori@leetcode.com |
| 14 | Erin | erin__@leetcode.com |[
{"user_id":10,"name":"Asha","mail":"A_1-2.x@leetcode.com"},
{"user_id":13,"name":"Dori","mail":"dori@leetcode.com"},
{"user_id":14,"name":"Erin","mail":"erin__@leetcode.com"}
]User 11 fails because the prefix starts with a digit. User 12 fails because the domain must match exact lowercase '@leetcode.com'.
users:
| user_id | name | mail |
|---------|--------|------------------------|
| 20 | Nila | @leetcode.com |
| 21 | Omar | -omar@leetcode.com |
| 22 | Pia | pia@leetcode.co |
| 23 | Quinn | q+in@leetcode.com |[]All rows violate at least one rule: empty prefix, non-letter prefix start, wrong domain, or disallowed '+' in prefix.
Constraints