A collection of 1-line solutions in different languages
C#\n\npublic class Solution {\n    public int NumUniqueEmails(string[] emails) =>\n        emails.Select(email => email.Substring(0, System.Text.RegularExpressi
**C#**\n```\npublic class Solution {\n    public int NumUniqueEmails(string[] emails) =>\n        emails.Select(email => email.Substring(0, System.Text.RegularExpressions.Regex.Match(email, "[+@]").Index).Replace(".", "") + email.Substring(email.IndexOf(\'@\'))).Distinct().Count();\n}\n```\n**JavaScript**\n```\n/**\n * @param {string[]} emails\n * @return {number}\n */\nfunction numUniqueEmails(emails) {\n    return new Set(emails.map(email => email.substr(0, email.search(/[+@]/)).replaceAll(\'.\', \'\') + email.substr(email.search(\'@\')))).size\n}\n```\n**Python**\n```\nclass Solution:\n    def numUniqueEmails(self, emails: List[str]) -> int:\n        return len(set(map(lambda email: email[:re.search(r\'[+@]\', email).start()].replace(\'.\', \'\') + email[email.find(\'@\'):], emails)))\n```\n**Ruby**\n```\n# @param {String[]} emails\n# @return {Integer}\ndef num_unique_emails(emails)\n    emails.map{|email| email[0, email.index(/[+@]/)].gsub(\'.\', \'\') + email[email.index(\'@\')..]}.uniq.size\nend\n```\n**Scala**\n```\nobject Solution {\n    def numUniqueEmails(emails: Array[String]): Int =\n        emails.map(email => email.substring(0, "[+@]".r.findFirstMatchIn(email).map(_.start).get).replace(".", "") + email.substring(email.indexOf("@"))).distinct.length\n}\n```\n**TypeScript**\n```\nfunction numUniqueEmails(emails: string[]): number {\n    return new Set(emails.map(email => email.substr(0, email.search(/[+@]/)).replace(/\\.+/g, \'\') + email.substr(email.search(\'@\')))).size\n}\n```
['Python', 'TypeScript', 'Scala', 'Ruby', 'JavaScript']