class Solution(object):
def numUniqueEmails(self, emails):
"""
:type emails: List[str]
:rtype: int
"""
email_set = set()
for email in emails:
elements = email.split('@')
email_set.add(elements[0].split('+')[0].replace('.', '') + elements[1])
return len(email_set)
Download Unique Email Addresses.pyLeetcode 929 Unique Email Addresses problem solution in python3 with explanation. This is the best place to expand your knowledge and get prepared for your next interview.
Feedback is the most important part of any website.
If you have any query, suggestion or feedback, Please feel free to contact us.