
Let 'emails' = ["test.email+alex@ninjas.com", "test.e.mail+bob.case@ninjas.com", "testemail@ninjas.com"].
We need to find the number of unique email addresses after applying the rules.
The first email "test.email+alex@ninjas.com":
The local name is "test.email+alex" and the domain name is "ninjas.com".
Applying the rules to the local name:
Remove '.' -> "testemail+alex"
Ignore everything after '+' -> "testemail"
The processed email address is "testemail@ninjas.com".
The second email "test.e.mail+bob.case@ninjas.com":
The local name is "test.e.mail+bob.case" and the domain name is "ninjas.com".
Applying the rules to the local name:
Remove '.' -> "testemail+bob.case"
Ignore everything after '+' -> "testemail"
The processed email address is "testemail@ninjas.com".
The third email "testemail@ninjas.com":
The local name is "testemail" and the domain name is "ninjas.com".
No '.' or '+' in the local name.
The processed email address is "testemail@ninjas.com".
The unique processed email addresses are {"testemail@ninjas.com"}.
Therefore, the number of different addresses that actually receive mails is 1.
The first line contains a single integer 'N' denoting the length of the array.
The second line contains the array of strings 'emails'.
Return a single integer, the number of different addresses that actually receive mails.
You don’t need to print anything. Just implement the given function.
1 <= 'N' <= 100
1 <= length of emails[i] <= 100
emails[i] consists of lowercase letters, '.', '+', and '@'.
Each emails[i] contains exactly one '@' character.
The local and domain names are non-empty.
Time Limit: 1 sec
Approach:
Algorithm:
Day 22 : Merge In Between
Day 22 : Merge In Between
Day 22 : Merge In Between
Day 22 : Merge In Between
Day 22 : Merge In Between
Zig-Zag of Matrix
Zig-Zag of Matrix
Zig-Zag of Matrix
Zig-Zag of Matrix
Max Frequency
Timing Sum
Timing Sum
Alien Dictionary
Alien Dictionary
Alien Dictionary