diff --git a/climbing-stairs/jeongyunjae.py b/climbing-stairs/jeongyunjae.py new file mode 100644 index 000000000..ef22b1c21 --- /dev/null +++ b/climbing-stairs/jeongyunjae.py @@ -0,0 +1,12 @@ +class Solution: + def climbStairs(self, n: int) -> int: + dp = [-1] + + for i in range(1,n+1): + if i == 1 or i == 2: + dp.append(i) + continue + + dp.append(dp[i-1] + dp[i-2]) + + return dp[n] diff --git a/valid-anagram/jeongyunjae.py b/valid-anagram/jeongyunjae.py new file mode 100644 index 000000000..dafd47bfd --- /dev/null +++ b/valid-anagram/jeongyunjae.py @@ -0,0 +1,6 @@ +class Solution: + def isAnagram(self, s: str, t: str) -> bool: + sort_s = ''.join(sorted(s)) + sort_t = ''.join(sorted(t)) + + return sort_s == sort_t