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 c10bdfe + 4381785 commit 3da51cbCopy full SHA for 3da51cb
climbing-stairs/rlawjd10.cpp
@@ -0,0 +1,21 @@
1
+// 피보나치 수열
2
+class Solution {
3
+public:
4
+ int climbStairs(int n) {
5
+
6
+ int prev1 = 1;
7
+ int prev2 = 1;
8
9
+ if (n == 1) return prev1;
10
11
+ for (int i = 2; i <= n; i++) {
12
+ int current = prev1 + prev2;
13
+ prev2 = prev1;
14
+ prev1 = current;
15
+ }
16
17
+ return prev1;
18
19
+};
20
21
valid-anagram/rlawjd10.cpp
@@ -0,0 +1,16 @@
+// 모든 철자가 있는지 확인
+ bool isAnagram(string s, string t) {
+ // 1. 문자열 정렬
+ sort(s.begin(), s.end());
+ sort(t.begin(), t.end());
+ // 2. 비교
+ if (s.compare(t) == 0)
+ return 1;
+ return 0;
0 commit comments