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 2db6f2c commit b72ba0dCopy full SHA for b72ba0d
climbing-stairs/higeuni.js
@@ -0,0 +1,17 @@
1
+// complexity
2
+// time: O(n)
3
+// space: O(1)
4
+
5
+var climbStairs = function(n) {
6
+ let num1 = 1;
7
+ let num2 = 1;
8
+ let temp = 0;
9
10
+ for(let i = 2; i<=n; ++i ) {
11
+ temp = num2;
12
+ num2 = num1 + num2;
13
+ num1 = temp;
14
+ }
15
16
+ return num2;
17
+};
valid-anagram/higeuni.js
@@ -0,0 +1,7 @@
+// time: O(n log n)
+// space: O(n)
+var isAnagram = function(s, t) {
+ return s.split('').sort().join('') === t.split('').sort().join('')
0 commit comments