Unique Email Addresses Problem Solution
Unique Email Addresses problem solved! Convert email to localName + domainName, ignore '+' and '.' for unique emails. Use Set to count unique emails.
Lets quickly go into the solution for the unique email addresses problem
we can see every email in localName + @ + domainName this form
let localName = email.split('@')[0] ?? '';
const domainName = email.split('@')[1];
And the question tells if localName has + sign in it we need to ignore the rest of the characters after it , example "m.y+name@email.com" is equal to "m.y@email.com"
if (localName.includes('+')) {
localName = localName.split('+')?.[0];
}
Also the question tells us that if we have . in email then it is considered as forwa...