Skip to content

Commit 670d85e

Browse files
committed
feat| create solution files
1 parent 8845572 commit 670d85e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

13_factorial/factorial.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const factorial = function() {
2+
3+
};
4+
5+
// Do not edit below this line
6+
module.exports = factorial;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const factorial = function(n) {
2+
if (/[.-]/.match(n + '')) return;
3+
if (n === 0 || n === 1) return 1;
4+
return factorial(n - 1) + factorial(n - 2);
5+
};
6+
7+
// Do not edit below this line
8+
module.exports = factorial;

0 commit comments

Comments
 (0)