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 8845572 commit 670d85eCopy full SHA for 670d85e
13_factorial/factorial.js
@@ -0,0 +1,6 @@
1
+const factorial = function() {
2
+
3
+};
4
5
+// Do not edit below this line
6
+module.exports = factorial;
13_factorial/solution/factorial-solution.js
@@ -0,0 +1,8 @@
+const factorial = function(n) {
+ if (/[.-]/.match(n + '')) return;
+ if (n === 0 || n === 1) return 1;
+ return factorial(n - 1) + factorial(n - 2);
7
8
0 commit comments