2018-05-29 22:27:20 +00:00
|
|
|
import java.lang.Integer;
|
|
|
|
|
2017-11-29 13:45:15 +00:00
|
|
|
class Faculty {
|
|
|
|
|
|
|
|
m () {
|
|
|
|
|
2018-09-10 11:14:36 +00:00
|
|
|
var fact = (x) -> {
|
2018-09-06 22:39:31 +00:00
|
|
|
if (x == 1) {
|
2018-06-15 14:19:12 +00:00
|
|
|
return x;
|
2018-09-06 22:39:31 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
return x * (fact.apply(x-1));
|
|
|
|
}
|
2017-11-29 13:45:15 +00:00
|
|
|
};
|
|
|
|
return fact;
|
|
|
|
}
|
|
|
|
}
|