Skip to content

20. Valid Parentheses#13

Merged
ryoooooory merged 2 commits intomainfrom
task/20
Jul 20, 2024
Merged

20. Valid Parentheses#13
ryoooooory merged 2 commits intomainfrom
task/20

Conversation

@ryoooooory
Copy link
Copy Markdown
Owner

}

private boolean isOpenCharacter(char c) {
return (c == '(' || c == '{' || c == '[');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

() 不要?

return (c == '(' || c == '{' || c == '[');
}

private boolean isPare(char left, char right) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pair

for (char current : cs) {
if (bucketPairs.containsKey(current)) {
buckets.push(current);
} else if (buckets.isEmpty() || current != bucketPairs.get(buckets.pop())) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

私はこの文長いと思います。

いろいろな選択肢が見えて書いているかが気になるところです。

この問題に関する記述が Discord サーバー内にあるはずなので調べておいてください。

Copy link
Copy Markdown
Owner Author

@ryoooooory ryoooooory Jun 17, 2024

Choose a reason for hiding this comment

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

リンク
などを参考に連想される知識および、ループないでの処理の書き方のバリデーションについてnote.mdやThirdSolution.javaに記載しました!

@@ -0,0 +1,38 @@
public class FirstSolution {
public boolean isValid(String s) {
Stack<Character> opanCharacters = new Stack<>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

opan になってますね

もしvscodeを使用してたら Code Spell Checkerという拡張機能があります 👍

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.

ありがとうございます!さっそくいれてみました!とても有用ですね!

@ryoooooory ryoooooory merged commit fdfbf20 into main Jul 20, 2024
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