We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7555cad commit 8918c97Copy full SHA for 8918c97
valid-palindrome/thispath98.py
@@ -0,0 +1,13 @@
1
+"""
2
+# Time Complexity: O(N)
3
+- N개의 char를 각각 한번씩 순회
4
+# Space Compelexity: O(N)
5
+- 최악의 경우 (공백이 없을 경우) N개의 char 저장
6
7
+class Solution:
8
+ def isPalindrome(self, s: str) -> bool:
9
+ string = [char.lower() for char in s if char.isalnum()]
10
+ for i in range(len(string) // 2):
11
+ if string[i] != string[-i - 1]:
12
+ return False
13
+ return True
0 commit comments