diff --git a/problems/leetcode_929.py b/problems/leetcode_929.py new file mode 100644 index 0000000..b39c7fc --- /dev/null +++ b/problems/leetcode_929.py @@ -0,0 +1,15 @@ +class Solution: + def numUniqueEmails(self, emails: List[str]) -> int: + unique = set() + + for e in emails: + i,local = 0 , "" + while e[i] not in ["@","+"]: + if e[i] != ".": + local += e[i] + i += 1 + while e[i] != "@": + i += 1 + domain = e[i + 1:] + unique.add((local,domain)) + return len(unique) \ No newline at end of file