Skip to content

Commit

Permalink
Create leetcode_929.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sujin-sreekumaran committed Jan 24, 2024
1 parent 8da21da commit 424bfd5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions problems/leetcode_929.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 424bfd5

Please sign in to comment.