leetcode - 929 -獨特的電子郵件地址
阿新 • • 發佈:2018-11-06
class Solution:
def numUniqueEmails(self, emails):
"""
:type emails: List[str]
:rtype: int
"""
a=[]
b=[]
count = 0
for ems in emails:
first = ems.split("@")[0].replace(".","").split("+")[0]
last = ems.split("@")[1]
email = first + "@" + last
a.append(email)
for i in range(len(a)):
if a[i] not in b:
b.append(a[i])
count += 1
return count