题解 | 牛群全排列数
牛群全排列数
https://www.nowcoder.com/practice/5ab233c23fcc4c69b81bd5a66c07041c
import java.util.*;
public class Solution {
private static final int mod = 1000000007;
public int factorial (int n) {
if (n == 1) {
return 1;
}
return (int)((long)n * (long)factorial(n - 1) % mod);
}
}
