Skip to content

929. Unique Email Addresses#13

Open
hiro111208 wants to merge 1 commit into
mainfrom
929-unique-email-address
Open

929. Unique Email Addresses#13
hiro111208 wants to merge 1 commit into
mainfrom
929-unique-email-address

Conversation

@hiro111208
Copy link
Copy Markdown
Owner

Comment thread step1.md
res = set()
for email in emails:
local_name, domain_name = email.split("@")
cleansed_local_name = local_name.replace(".", "").split("+")[0]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

複数の処理が 1 行に押し込められており、やや見にくいように感じました。 2 行に分けるとよいと思います。

cleansed_local_name = local_name.replace(".", "")
cleansed_local_name = cleansed_local_name.split("+")[0]

Comment thread step1.md
res = set()
for email in emails:
local_name, domain_name = email.split("@")
cleansed_local_name = local_name.replace(".", "").split("+")[0]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

比較のために正規化をすることを canonicalize と呼びます。 canonicalized_local_name はいかがでしょうか?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご指摘いただきありがとうございます。以後使わせていただきます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants