Skip to content

Commit 7a268a5

Browse files
committed
update from Atlas
1 parent 0b9d411 commit 7a268a5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

operator/factorial/CorrectFactorial.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import java.math.BigInteger;
22

33
class CorrectFactorial {
4-
static final BigInteger two = new BigInteger("2");
5-
64
public static BigInteger factorial(BigInteger n) {
7-
return n.compareTo(two) < 0 ? BigInteger.ONE
5+
return n.compareTo(BigInteger.ONE) <= 0 ? BigInteger.ONE
86
: n.multiply(factorial(n.subtract(BigInteger.ONE)));
97
}
108

0 commit comments

Comments
 (0)