[Java] Clean O(n*maxStringLen) with and without split()
With split\n\nclass Solution {\n    public int numUniqueEmails(String[] emails) {\n        Set<String> set = new HashSet<>();\n        for (String email : email
**With split**\n```\nclass Solution {\n    public int numUniqueEmails(String[] emails) {\n        Set<String> set = new HashSet<>();\n        for (String email : emails){\n            String[]parts = email.split("@");\n            String local = parseLocal(parts[0]);\n            String domain = parts[1];\n            set.add(local + \'@\' + domain);\n        }\n            return set.size();\n\n    }\n    \n    \n    String parseLocal(String local){\n        StringBuilder sb = new StringBuilder();\n        for (char c : local.toCharArray()){\n            if (c != \'.\'){//Skip the period characters\n                if (c == \'+\') return sb.toString(); //Ignore everything else\n                sb.append(c); //Not a period and not a + character\n            }\n        }\n        \n        return sb.toString();\n    }\n    \n}\n\n```\n\n**Without split**\n```\nclass Solution {\n    public int numUniqueEmails(String[] emails) {\n        Set<String> set = new HashSet<>();\n        for (String email : emails){\n            String[]parts = getParts(email);\n            String local = parseLocal(parts[0]);\n            String domain = parts[1];\n            set.add(local + \'@\' + domain);\n        }\n            return set.size();\n\n    }\n    \n    \n    String parseLocal(String local){\n        StringBuilder sb = new StringBuilder();\n        for (char c : local.toCharArray()){\n            if (c != \'.\'){//Skip the period characters\n                if (c == \'+\') return sb.toString(); //Ignore everything else\n                sb.append(c); //Not a period and not a + character\n            }\n        }\n        \n        return sb.toString();\n    }\n    \n    String[] getParts(String email){\n        int i = 0;\n        while (i < email.length() && email.charAt(i) != \'@\') i++;\n        return new String[]{email.substring(0, i), email.substring(i+1)};\n    }\n    \n}\n\n\n```
[]