Leetcode 965 Solution
This article provides solution to leetcode question 965 (unique-email-addresses)
Access this page by simply typing in "lcs 965" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/unique-email-addresses
Solution
class Solution:
def numUniqueEmails(self, emails: 'List[str]') -> 'int':
res = set()
for email in emails:
name, domain = email.split('@')
name = name.split('+')[0]
name = name.replace(".", "")
res.add("{}@{}".format(name, domain))
return len(res);