Skip to content

Commit 81934ec

Browse files
committed
Add placeholder for solution 2
1 parent e90447e commit 81934ec

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

valid-palindrome/KwonNayeon.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
"""
2-
Title: 215. Valid Palindrome
3-
Link: https://leetcode.com/problems/valid-palindrome/
4-
5-
Summary:
6-
- Palindrome이라면 True, 아니라면 False를 반환하는 문제.
7-
- Palindrome이란, 앞으로 읽어도 뒤에서부터 읽어도 동일한 단어를 뜻함.
8-
- 추가 조건: 대소문자를 구분하지 않으며, 알파벳과 숫자 이외의 문자는 제거해야 함.
9-
- e.g. racecar
10-
112
Conditions:
12-
- 입력 문자열이 Palindrome인 경우: `True` 반환
13-
- Palindrome이 아닌 경우: `False` 반환
3+
- 1 <= s.length <= 2 * 10^5
4+
- s consists only of printable ASCII characters.
145
156
Time Complexity:
16-
- O(n)
7+
- O(n)
178
Space Complexity:
18-
- O(n)
9+
- O(n)
1910
"""
11+
# Solution 1
2012
class Solution:
2113
def isPalindrome(self, s: str) -> bool:
2214
s = re.sub(r'[^a-zA-z0-9]', '', s).lower()
2315
if s == s[::-1]:
2416
return True
2517
return False
2618

19+
# Solution 2

0 commit comments

Comments
 (0)