JavaScript 4 lines 2 solutions
Add all of filtered email addresses in to the Set\n2. Return a size of the Set.\n- Time Complexity: O(N)\n- Space Complexity: O(N)\nJavaScript\n/**\n * @param {
1. Add all of filtered email addresses in to the Set\n2. Return a size of the Set.\n- Time Complexity: O(N)\n- Space Complexity: O(N)\n```JavaScript\n/**\n * @param {string[]} emails\n * @return {number}\n */\nvar numUniqueEmails = emails => new Set(emails.map(a => {\n    const [local, domain] = a.split(\'@\');\n    return `${local.split(\'+\')[0].split(\'.\').join(\'\')}@${domain}`;\n})).size;\n```\n\nUsing regex\n```JavaScript\n/**\n * @param {string[]} emails\n * @return {number}\n */\nvar numUniqueEmails = emails => new Set(emails.map(a => {\n    const [local, domain] = a.split(\'@\');\n    return `${local.replace(/\\+.*/, \'\').replace(/\\./g, \'\')}@${domain}`;\n})).size;\n```
['JavaScript']