a few solutions
Erase \'.\' chars and all chars following \'+\' inclusive from the user-part, then concatenate the user/domain-parts into a unique set.\n\n---\n\nKotlin\n\nclas
Erase `\'.\'` chars and all chars following `\'+\'` inclusive from the user-part, then concatenate the user/domain-parts into a `unique` set.\n\n---\n\n*Kotlin*\n```\nclass Solution {\n    fun numUniqueEmails(A: Array<String>): Int {\n        var unique = mutableSetOf<String>()\n        for (email in A) {\n            var (user, domain) = email.split("@")\n            user = user.split("").filter{ it != "." }.joinToString("")\n            var i = user.indexOf(\'+\')\n            if (-1 < i)\n                user = user.substring(0, i)\n            unique.add("$user@$domain")\n        }\n        return unique.size\n    }\n}\n```\n\n*Javascript*\n```\nlet numUniqueEmails = (A, unique = new Set()) => {\n    for (let email of A) {\n        let [user, domain] = email.split(\'@\');\n        user = user.split(\'\').filter(c => c != \'.\').join(\'\');\n        let i = user.indexOf(\'+\');\n        if (-1 < i)\n            user = user.substring(0, i);\n        unique.add(`${user}@${domain}`);\n    }\n    return unique.size;\n};\n```\n\n*Python3*\n```\nclass Solution:\n    def numUniqueEmails(self, A: List[str]) -> int:\n        unique = set()\n        for email in A:\n            user, domain = email.split(\'@\')\n            user = user.replace(\'.\', \'\')\n            i = user.find(\'+\')\n            if -1 < i:\n                user = user[0 : i]\n            unique.add(f\'{user}@{domain}\')\n        return len(unique)\n```\n\n*C++*\n```\nclass Solution {\npublic:\n    using VS = vector<string>;\n    using Set = unordered_set<string>;\n    int numUniqueEmails(VS& A, Set unique = {}) {\n        for (auto& email: A) {\n            auto pivot = email.find(\'@\');\n            auto user = email.substr(0, pivot),\n                 domain = email.substr(pivot + 1);\n            user.erase(remove_if(user.begin(), user.end(), [](auto c) { return c == \'.\'; }), user.end());\n            auto i = user.find(\'+\');\n            if (i != string::npos)\n                user = user.substr(0, i);\n            unique.insert(user + \'@\' + domain);\n        }\n        return unique.size();\n    }\n};\n```
[]