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.
2 parents 77902af + 4e5be4e commit b68ae4aCopy full SHA for b68ae4a
climbing-stairs/do-heewan.py
@@ -0,0 +1,11 @@
1
+class Solution:
2
+ def climbStairs(self, n: int) -> int:
3
+ dp = [0] * 46
4
+ dp[1] = 1
5
+ dp[2] = 2
6
+
7
+ for i in range(3, n+1):
8
+ dp[i] = dp[i-1] + dp[i-2]
9
10
+ return dp[n]
11
product-of-array-except-self/do-heewan.py
@@ -0,0 +1,16 @@
+ def productExceptSelf(self, nums: List[int]) -> List[int]:
+ result = []
+ x = 1
+ for element in nums:
+ result.append(x)
+ x *= element
+ for i in range(len(nums)-1, -1, -1):
12
+ result[i] *= x
13
+ x *= nums[i]
14
15
+ return result
16
valid-anagram/do-heewan.py
@@ -0,0 +1,4 @@
+ def isAnagram(self, s: str, t: str) -> bool:
+ return sorted(s) == sorted(t)
0 commit comments