Java Straightforward Solution
Code\n\nclass Solution {\n    public int numUniqueEmails(String[] emails) {\n        Set<String> set = new HashSet<>();\n        for (String email : emails) {\n
# Code\n```\nclass Solution {\n    public int numUniqueEmails(String[] emails) {\n        Set<String> set = new HashSet<>();\n        for (String email : emails) {\n            int indexOfAt = email.indexOf(\'@\');\n            String front = email.substring(0, indexOfAt);\n            int index = front.indexOf(\'+\');\n            if (index >= 0) {\n                front = front.substring(0, index);\n            }\n            front = front.replaceAll("\\\\.", "");\n            String finalString = front + email.substring(indexOfAt);\n            set.add(finalString);\n        }\n        return set.size();\n    }\n}\n```
['Java']