From d4394bdcf8949dce33871cc9fd664207ee49830a Mon Sep 17 00:00:00 2001 From: Young Choi Date: Fri, 28 Nov 2025 11:25:12 -0800 Subject: [PATCH 1/2] [WHYjun] WEEK 03 solutions - (1/5) --- valid-palindrome/WHYjun.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 valid-palindrome/WHYjun.py diff --git a/valid-palindrome/WHYjun.py b/valid-palindrome/WHYjun.py new file mode 100644 index 0000000000..0a214b7d02 --- /dev/null +++ b/valid-palindrome/WHYjun.py @@ -0,0 +1,14 @@ +class Solution: + def isPalindrome(self, s: str) -> bool: + s = [c.lower() for c in s if c.isalnum()] + + if len(s) == 1: + return True + + l, r = 0, len(s) - 1 + while l < r: + if s[l] != s[r]: + return False + l += 1 + r -= 1 + return True From 786620118b9585228ece7ffea777130e71dcc1e4 Mon Sep 17 00:00:00 2001 From: Young Choi Date: Fri, 28 Nov 2025 19:42:13 -0800 Subject: [PATCH 2/2] [WHYjun] WEEK 03 solutions - (2/5) --- number-of-1-bits/WHYjun.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 number-of-1-bits/WHYjun.py diff --git a/number-of-1-bits/WHYjun.py b/number-of-1-bits/WHYjun.py new file mode 100644 index 0000000000..99ffbaab56 --- /dev/null +++ b/number-of-1-bits/WHYjun.py @@ -0,0 +1,7 @@ +class Solution: + def hammingWeight(self, n: int) -> int: + result = 0 + for i in range(32): + if (n >> i) & 1: + result += 1 + return result