leetcode - 929 -独特的电子邮件地址

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

            

猜你喜欢

转载自blog.csdn.net/hustwayne/article/details/83544646
今日推荐