Java Solution
Code\n\nclass Solution {\n    public int numUniqueEmails(String[] emails) {\n        if (emails.length == 1) {\n            return 1;\n        }\n\n        Hash
# Code\n```\nclass Solution {\n    public int numUniqueEmails(String[] emails) {\n        if (emails.length == 1) {\n            return 1;\n        }\n\n        HashSet<String> emailSet = new HashSet<>();\n        int result = 0;\n\n        for (String email : emails) {\n            int com = email.indexOf("@");\n            int plus = email.indexOf("+");\n            String res = email;\n            \n            if (plus > 0) {\n                res = email.substring(0, plus) + email.substring(com);\n            }\n            com = res.indexOf("@");\n            while (res.indexOf(".") < com) {\n                com = res.indexOf("@");\n                res = res.substring(0, res.indexOf(".")) + res.substring(res.indexOf(".") + 1);\n            }\n\n            if (emailSet.contains(res)) {\n                continue;\n            }\n\n            emailSet.add(res);\n            result++;\n        }\n\n        return result;\n    }\n}\n```
['Java']