Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- matrix
- hash table
- 미디움
- 중간
- recursive
- HashTable
- linked list
- 리트코드
- 문자열
- math
- backtracking
- DP
- 이진트리
- two pointers
- binary tree
- leetcode
- 재귀
- sorting
- Medium
- binary search
- string
- list
- Array
- easy
- Depth-first Search
- tree
- Python
- 쉬움
- dfs
- Binary
Archives
- Today
- Total
목록Valid Parentheses (1)
부부의 코딩 성장 일기
LeetCode 20(Valid Parentheses, Python)
1. 문제 링크 https://leetcode.com/problems/valid-parentheses/ 2. 문제 설명 (){}[]로만 구성된 string이 주어졌을 때 아래 3가지 요건을 다 만족하는지 판단 - True or False 반환 열린 괄호 ( { ] 는 같은 유형의 괄호에 의해 닫혀야 한다. 열린 괄호는 올바른 순서로 닫혀야 한다. 각 닫는 괄호는 동일 유형의 열린 괄호와 대응해야 한다. 예시) "()" true, "()[]{}" true, "(]" false 3. 처음 풀이 true인 string은 무조건 [], {}, () 중 하나의형태를 포함하고 있다. 단순하게 열고 닫는 괄호 이웃한 것을 한 쌍 한쌍 삭제하는 구조 class Solution: def isValid(self, s: s..
Algorithm/LeetCode
2023. 11. 1. 19:00