LeetCode solutions

1664. Find Users With Valid E-Mails

My accepted SQL solution to LeetCode problem 1664, Find Users With Valid E-Mails, running in 710ms.

  • Difficulty: Easy
  • SQL
  • Runtime 710ms
  • Memory 0.0B

Read the problem on LeetCode View on GitHub

SQL

Accepted on LeetCode — runtime 710ms, memory 0.0B, accepted 2026-01-02.

sql
# Write your MySQL query statement below
SELECT *
FROM Users
WHERE mail LIKE '%@leetcode.com' COLLATE utf8mb4_bin
  AND mail REGEXP '^[a-zA-Z][a-zA-Z0-9_.-]*@leetcode\.com$'

Source