#K63402. Unique Email Addresses

    ID: 31745 Type: Default 1000ms 256MiB

Unique Email Addresses

Unique Email Addresses

Given a list of email addresses, your task is to determine the number of unique email addresses after processing them. For each email address, consider it to be composed of two parts separated by the '@' symbol: the local part and the domain. Transform the local part by removing all occurrences of the dot character ('.') and ignoring any characters after (and including) the first plus sign ('+'). The domain part remains unchanged. Formally, for an email address ss where s=L@Ds = L@D, let LL' be defined as [ L' = \text{removeDots}(\text{prefixBefore}(L, '+')) ] Then the processed email becomes L@DL'@D. Return the number of unique processed email addresses.

Input is given via standard input and output via standard output.

inputFormat

The first line contains an integer nn denoting the number of email addresses. Each of the next nn lines contains one email address.

outputFormat

Output a single integer, the number of unique email addresses after processing.## sample

3
test.email+alex@leetcode.com
test.e.mail+bob.cathy@leetcode.com
testemail+david@lee.tcode.com
2