Skip to content

695. Max Area of Island#18

Open
hemispherium wants to merge 1 commit into
mainfrom
695-max-area-of-island
Open

695. Max Area of Island#18
hemispherium wants to merge 1 commit into
mainfrom
695-max-area-of-island

Conversation

@hemispherium
Copy link
Copy Markdown
Owner

@hemispherium hemispherium commented Apr 9, 2026

@hemispherium hemispherium self-assigned this Apr 9, 2026
public:
int m, n;

void countArea(vector<vector<int>>& grid, int x, int y, int& val) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

関数名は UpperCamel で書くのをよく見かけます。この辺りはチームの平均的な書き方に合わせることをお勧めいたします。

参考までにスタイルガイドへのリンクを共有いたします。

https://google.github.io/styleguide/cppguide.html#Function_Names

Ordinarily, functions follow PascalCase: start with a capital letter and have a capital letter for each new word.

なお、このスタイルガイドは“唯一の正解”というわけではなく、数あるガイドラインの一つに過ぎません。チームによって重視される書き方や慣習も異なります。そのため、ご自身の中に基準を持ちつつも、最終的にはチームの一般的な書き方に合わせることをお勧めします。

public:
int m, n;

void countArea(vector<vector<int>>& grid, int x, int y, int& val) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

val という変数名は、中にどのような値が格納されているのか想像しづらく感じました。 area はいかがでしょうか?

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.

areaの方がよさそうですね。

public:
int m, n;

void countArea(vector<vector<int>>& grid, int x, int y, int& val) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

出力を引数で参照渡しするほか、戻り値で返すこともできると思います。この辺りはチームの平均的な書き方に合わせることをお勧めいたします。

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