[Java] Easy solution
\nclass Solution {\n    public int numUniqueEmails(final String[] emails) {\n        final Set<String> set = new HashSet<>();\n        int count = 0;\n\n       
```\nclass Solution {\n    public int numUniqueEmails(final String[] emails) {\n        final Set<String> set = new HashSet<>();\n        int count = 0;\n\n        for(final String email : emails) {\n            final StringBuilder sb = new StringBuilder();\n            int i = 0;\n            boolean isLocalName = true;\n\n            while(i < email.length()) {\n                if(isLocalName) {\n                    if(email.charAt(i) == \'+\')\n                        while(i < email.length() && email.charAt(i) != \'@\')\n                            i++;\n\n                    if(email.charAt(i) != \'.\')\n                        sb.append(email.charAt(i));\n\n                    if(email.charAt(i) == \'@\')\n                        isLocalName = false;\n                } else {\n                    sb.append(email.charAt(i));\n                }\n\n                i++;\n            }\n\n            final String e = sb.toString();\n\n            if(!set.contains(e)) {\n                set.add(e);\n                count++;\n            }\n        }\n\n        return count;\n    }\n}\n```
['Java']