Skip to content

20. Valid Parentheses.md #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

20. Valid Parentheses.md #7

wants to merge 3 commits into from

Conversation

lilnoahhh
Copy link
Owner

20. Valid Parentheses
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

An input string is valid if:

Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Every close bracket has a corresponding open bracket of the same type.
次は206. Reverse Linked List

@@ -0,0 +1 @@
20. Valid Parentheses

Choose a reason for hiding this comment

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

コードの書き忘れでしょうか?

Copy link
Owner Author

Choose a reason for hiding this comment

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

まだ完成していないので終わり次第レビュー依頼に投げさせていただきます。
その際はよろしくおねがいいたします

Choose a reason for hiding this comment

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

失礼しました!!

(https://discord.com/channels/1084280443945353267/1201211204547383386/1202541275115425822)
上の用語わからなすぎて調べる。
おそらく形式言語理論の概念を用いてこの問題を解釈している?
うちの学校のカリキュラムにはないが、形式言語理論の勉強はSWEとして必須?
Copy link

Choose a reason for hiding this comment

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

多くの人が一応知っている感じはありますが、あまり聞かれないやつです。

Copy link
Owner Author

Choose a reason for hiding this comment

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

そうだったんですね。余力があれば勉強してみます!

2回目3分38
3回目2分48

'''python
Copy link

Choose a reason for hiding this comment

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

バッククォート`です。

```python
class Solution:
def isValid(self, s: str) -> bool:
valied_input = ["(",")","{","}","[","]"]
Copy link

Choose a reason for hiding this comment

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

valid_input = "(){}[]"
というのでも in で判定できます。


https://github.com/yus-yus/leetcode/pull/6
かなり勉強になった。
特に問題文にはないが、brackets以外が入力として与えられた場合も考えているのがすごくためになった。
Copy link

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.

4 participants