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 e61b656 commit 4d69389Copy full SHA for 4d69389
climbing-stairs/jiyseo.py
@@ -0,0 +1,17 @@
1
+class Solution(object):
2
+ def fac(self, n) :
3
+ fac = 1
4
+ for i in range(1, n + 1) :
5
+ fac *= i
6
+ return fac
7
+
8
+ def climbStairs(self, n):
9
+ res = 0
10
+ for i in range(n // 2 + 1) :
11
+ if i == 0 :
12
+ res += 1
13
+ else :
14
+ cnt = n - i
15
+ res += Solution().fac(cnt)/(Solution().fac(i) * Solution().fac(cnt - i))
16
+ return res
17
valid-anagram/jiyseo.py
@@ -0,0 +1,12 @@
+ def isAnagram(self, s, t):
+ # 시간복잡도 = O(N * (N + M))
+ if len(s) != len(t) :
+ return False
+ for i in set(s) :
+ if s.count(i) != t.count(i) :
+ return True
0 commit comments