We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8de9b61 commit ea48b17Copy full SHA for ea48b17
src/main/java/com/fishercoder/solutions/_929.java
@@ -18,11 +18,7 @@ public int numUniqueEmails(String[] emails) {
18
filteredLocalName = filteredLocalName.replace(".", "");
19
map.get(parts[1]).add(filteredLocalName);
20
}
21
- int n = 0;
22
- for (String key : map.keySet()) {
23
- n += map.get(key).size();
24
- }
25
- return n;
+ return map.keySet().stream().mapToInt(key -> map.get(key).size()).sum();
26
27
28
0 commit comments