1517. Find Users With Valid E-Mails LeetCode Solution
In this guide, you will get 1517. Find Users With Valid E-Mails LeetCode Solution with the best time and space complexity. The solution to Find Users With Valid E-Mails problem is provided in various programming languages like C++, Java, and Python. This will be helpful for you if you are preparing for placements, hackathons, interviews, or practice purposes. The solutions provided here are very easy to follow and include detailed explanations.
Table of Contents
- Problem Statement
- Complexity Analysis
- Find Users With Valid E-Mails solution in C++
- Find Users With Valid E-Mails solution in Java
- Find Users With Valid E-Mails solution in Python
- Additional Resources
Problem Statement of Find Users With Valid E-Mails
Table: Users
+—————+———+
| Column Name | Type |
+—————+———+
| user_id | int |
| name | varchar |
| mail | varchar |
+—————+———+
user_id is the primary key (column with unique values) for this table.
This table contains information of the users signed up in a website. Some e-mails are invalid.
Write a solution to find the users who have valid emails.
A valid e-mail has a prefix name and a domain where:
The prefix name is a string that may contain letters (upper or lower case), digits, underscore ‘_’, period ‘.’, and/or dash ‘-‘. The prefix name must start with a letter.
The domain is ‘@leetcode.com’.
Return the result table in any order.
The result format is in the following example.
Example not found
Constraints not found
Complexity Analysis
- Time Complexity: Google AdSense
- Space Complexity: Google Analytics
1517. Find Users With Valid E-Mails LeetCode Solution in C++
SELECT *
FROM Users
WHERE REGEXP_LIKE(mail, '^[A-Za-z]+[A-Za-z0-9\_\.\-]*@leetcode\\.com$');
/* code provided by PROGIEZ */
1517. Find Users With Valid E-Mails LeetCode Solution in Java
N/A
// code provided by PROGIEZ
1517. Find Users With Valid E-Mails LeetCode Solution in Python
N/A
# code by PROGIEZ
Additional Resources
- Explore all LeetCode problem solutions at Progiez here
- Explore all problems on LeetCode website here
Happy Coding! Keep following PROGIEZ for more updates and solutions.