Dsa
Hashing
Warm-up
Unique Email Count
Given a list of email addresses, count the number of unique email addresses. An email address may have '.' characters (which can be ignored) and '+' characters (which allow for ignoring anything after the '+' in the local part of the address). The structure of an email address is: local_part@domain. For example, 'test.email+alex@leetcode.com' and 'test.e.mail+bob@leetcode.com' both represent the same email address, 'testemail@leetcode.com'.
Input Format:
- A single line containing multiple email addresses separated by spaces.
Output Format:
- Print the count of unique email addresses.
Example:
Input:
"test.email+alex@leetcode.com test.e.mail+bob@leetcode.com testemail@leetcode.com"
Output:
1
Key concepts
hashingstrings
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now