4MS || ✅🔥BEATS 100% PROOF🔥 || 💡CONCISE CODE✅ || 🌟JAVA || 🧑‍💻 BEGINNER FREINDLY
Code
# Code
```java []
class Solution {
    public int numUniqueEmails(String[] emails) {
        Set<String> uniqueEmails = new HashSet<>();
        for (String email: emails) {
            uniqueEmails.add(normalizeEmail(email));
        }
        return uniqueEmails.size();
    }

    private String normalizeEmail(String email) {
        int domainIndex = email.indexOf('@');
        StringBuilder sb = new StringBuilder(email.length());
        
        // Build local part
        for (int index = 0; index < domainIndex; index++) {
            char ch = email.charAt(index);
            if (ch == '+') break;  // Ignore the rest of the local part
            if (ch != '.') sb.append(ch);  // Ignore dots
        }
        
        // Append the domain part
        sb.append(email.substring(domainIndex));
        
        return sb.toString();
    }
}
```

![7b3ed9e7-75a3-497e-85ef-237ed4f4fef7_1735690315.3860667.png](https://assets.leetcode.com/users/images/9558b339-96ea-441e-8a09-1cb8c6ac9ef4_1737019448.9638507.png)

['Java']