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 d975b97 commit d62d45fCopy full SHA for d62d45f
contains-duplicate/jinah92.py
@@ -0,0 +1,10 @@
1
+class Solution:
2
+ def containsDuplicate(self, nums: List[int]) -> bool:
3
+ keys = set()
4
+ for num in nums:
5
+ if num in keys:
6
+ return True
7
+ else:
8
+ keys.add(num)
9
+
10
+ return False
valid-palindrome/jinah92.py
@@ -0,0 +1,19 @@
+import re
+ def isPalindrome(self, s: str) -> bool:
+ replaced_string = re.sub(r"[^a-zA-Z0-9]", "", s).lower()
+ if len(replaced_string) == 0:
+ start, end = 0, len(replaced_string)-1
11
12
+ while start <= len(replaced_string) // 2:
13
+ if replaced_string[start] is not replaced_string[end]:
14
15
16
+ start += 1
17
+ end -= 1
18
19
0 commit comments