Skip to content

Commit 08a430a

Browse files
committed
solved: 929
1 parent 4c10705 commit 08a430a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

code/929.unique-email-addresses.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @leet start
2+
function numUniqueEmails(emails: string[]): number {
3+
const s = new Set<string>();
4+
for (const e of emails) {
5+
const [f, a] = e.trim().split("@");
6+
const mf = f.split("+")[0].replace(/\./g, "");
7+
const b = `${mf.trim()}@${a.trim()}`;
8+
s.add(b);
9+
}
10+
return s.size;
11+
}
12+
// @leet end
13+

0 commit comments

Comments
 (0)