Skip to content

Commit

Permalink
Sync LeetCode submission Runtime - 823 ms (32.79%), Memory - 0B (100.…
Browse files Browse the repository at this point in the history
…00%)
  • Loading branch information
DhanushNehru committed Mar 24, 2024
1 parent 93333f6 commit 20d6a80
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions 0182-duplicate-emails/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<p>Table: <code>Person</code></p>

<pre>
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| id | int |
| email | varchar |
+-------------+---------+
id is the primary key (column with unique values) for this table.
Each row of this table contains an email. The emails will not contain uppercase letters.
</pre>

<p>&nbsp;</p>

<p>Write a solution to report all the duplicate emails. Note that it&#39;s guaranteed that the email&nbsp;field is not NULL.</p>

<p>Return the result table in <strong>any order</strong>.</p>

<p>The&nbsp;result format is in the following example.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong>
Person table:
+----+---------+
| id | email |
+----+---------+
| 1 | [email protected] |
| 2 | [email protected] |
| 3 | [email protected] |
+----+---------+
<strong>Output:</strong>
+---------+
| Email |
+---------+
| [email protected] |
+---------+
<strong>Explanation:</strong> [email protected] is repeated two times.
</pre>
2 changes: 2 additions & 0 deletions 0182-duplicate-emails/solution.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Write your MySQL query statement below
SELECT email as Email FROM Person GROUP BY Email HAVING COUNT(*) > 1;

0 comments on commit 20d6a80

Please sign in to comment.