Guest User

Untitled

a guest
Dec 20th, 2018
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. def numUniqueEmails(emails):
  2. """
  3. :type emails: List[str]
  4. :rtype: int
  5. """
  6. new_email_list = []
  7. for email in emails:
  8. local, domain = email.split("@")[0],email.split("@")[1]
  9. print(local)
  10. removeDotLocal = "".join(local.split("."))
  11. print(removeDotLocal)
  12. newLocal = removeDotLocal.split("+")[0]
  13. print(newLocal)
  14. new_email = [newLocal + "@" + domain]
  15. print("new_email is", new_email)
  16. if new_email[0] not in new_email_list:
  17. new_email_list = new_email_list+ new_email
  18. return new_email_list
  19. print((numUniqueEmails(["a.bc1+d@email.com","a.bc1+de@email.com","a.b.c3+d@email.com"])))
Add Comment
Please, Sign In to add comment