Skip to content

Conversation

@potrue
Copy link
Owner

@potrue potrue commented Aug 21, 2025

}
private:
void generateParenthesisHelper(
const int n,
Copy link

Choose a reason for hiding this comment

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

関数の引数にプリミティブ型を渡す場合は const は付けないことが多いと思います。 n/num_open/num_close で const がついていたりついていなかったりするのも気になりました。

int num_open,
int num_close,
vector<string>& result
) {

Choose a reason for hiding this comment

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

好みの範囲かもしれませんが、num_open を これから parentheses に追加すべき数にすると n を渡さずに済むので好きです。お書きいただいた parentheses の中にある数を num_open とすると、重複している情報が渡されている点が気になりました(含まれている個数は数えたらわかるので)。

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.

4 participants