Given an array of strings emails where each string represents an email address, return the number of distinct email addresses that actually receive mail after normalization.
Each email address contains a local name and a domain name separated by an '@' character.
The normalization rules are as follows:
Local Name Rules:
Characters are case insensitive, so all uppercase letters are converted to lowercase.
Any periods '.' are ignored and removed.
If a plus character '+' appears, all characters following the first '+' are ignored and removed.
Domain Name Rules:
Characters are case insensitive, so all uppercase letters are converted to lowercase.
Periods '.' are preserved.
Two email addresses are considered part of the same group if their normalized forms are identical.
Constraints:
emails.length
emails[i].length
emails[i] consists of lowercase and uppercase English letters, digits, and the characters '.' , '+', and '@'.
Each emails[i] contains exactly '@' character.
All local and domain names are non-empty; local names do not start with '+'.
Domain names end with the ".com" suffix and contain at least ".com".
Given an array of strings emails where each string represents an email address, return the number of distinct email addresses that actually receive mail after normalization.
Each email address contains a local name and a domain name separated by an '@' character.
The normalization rules are as follows:
Local Name Rules:
Characters are case insensitive, so all uppercase letters are converted to lowercase.
Any periods '.' are ignored and removed.
If a plus character '+' appears, all characters following the first '+' are ignored and removed.
Domain Name Rules:
Characters are case insensitive, so all uppercase letters are converted to lowercase.
Periods '.' are preserved.
Two email addresses are considered part of the same group if their normalized forms are identical.
Constraints:
emails.length
emails[i].length
emails[i] consists of lowercase and uppercase English letters, digits, and the characters '.' , '+', and '@'.
Each emails[i] contains exactly '@' character.
All local and domain names are non-empty; local names do not start with '+'.
Domain names end with the ".com" suffix and contain at least ".com".