Skip to content

49. Group Anagrams#14

Open
TORUS0818 wants to merge 2 commits intomainfrom
49
Open

49. Group Anagrams#14
TORUS0818 wants to merge 2 commits intomainfrom
49

Conversation

@TORUS0818
Copy link
Copy Markdown
Owner


```python
from collections import defaultdict

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

全体的にどの回答も読みやすかったです。自分はソートした s をキーにする方法は思いつかなかったのですが、s が小さければソートも重くないと思うのでよいですね。

一点、フォーマッタで自動で整形されそうですが、import のあとの改行が1行だったり2行だったりするのが気になりました。

import 文に続く処理が、import 関連かそうでないものかでも変わると思うのですが、トップレベルの import のあとは2行開けるのものなのかと思いました。(PEP8に、Surround top-level function and class definitions with two blank lines. Method definitions inside a class are surrounded by a single blank line. とあったためです)
https://peps.python.org/pep-0008/#blank-lines

実際どうなっているか chromium と cpython を調べたところ、

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.

有難うございます。励みになります!

はい、意図したものではないです。。ご指摘のとおり、PEP8に則り基本的には2行空けるようにしていた(つもり)でした。
chromium と cpythonの調査もして頂き有難うございました!
確認しますね。

import文後の空行を2行に統一
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