-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path929.unique-email-addresses.py
89 lines (86 loc) · 2.38 KB
/
929.unique-email-addresses.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#
# @lc app=leetcode id=929 lang=python3
#
# [929] Unique Email Addresses
#
# https://leetcode.com/problems/unique-email-addresses/description/
#
# algorithms
# Easy (67.46%)
# Likes: 2743
# Dislikes: 352
# Total Accepted: 527.8K
# Total Submissions: 782.2K
#
# Every valid email consists of a local name and a domain name, separated by
# the '@' sign. Besides lowercase letters, the email may contain one or more
# '.' or '+'.
#
#
# For example, in "[email protected]", "alice" is the local name, and
# "leetcode.com" is the domain name.
#
#
# If you add periods '.' between some characters in the local name part of an
# email address, mail sent there will be forwarded to the same address without
# dots in the local name. Note that this rule does not apply to domain
# names.
#
#
# For example, "[email protected]" and "[email protected]" forward to the
# same email address.
#
#
# If you add a plus '+' in the local name, everything after the first plus sign
# will be ignored. This allows certain emails to be filtered. Note that this
# rule does not apply to domain names.
#
#
# For example, "[email protected]" will be forwarded to "[email protected]".
#
#
# It is possible to use both of these rules at the same time.
#
# Given an array of strings emails where we send one email to each emails[i],
# return the number of different addresses that actually receive mails.
#
#
# Example 1:
#
#
# Input: emails =
# Output: 2
# Explanation: "[email protected]" and "[email protected]" actually
# receive mails.
#
#
# Example 2:
#
#
# Output: 3
#
#
#
# Constraints:
#
#
# 1 <= emails.length <= 100
# 1 <= emails[i].length <= 100
# emails[i] consist of lowercase English letters, '+', '.' and '@'.
# Each emails[i] contains exactly one '@' character.
# All local and domain names are non-empty.
# Local names do not start with a '+' character.
# Domain names end with the ".com" suffix.
# Domain names must contain at least one character before ".com" suffix.
#
#
#
# @lc code=start
from ast import List
class Solution:
def numUniqueEmails(self, emails: List[str]) -> int:
return 1
# @lc code=end