It seems that recursion is used, can you explain the idea?
阿神2017-05-19 10:10:12
var A = function(N,M,num){
if( N < M || N <= 0) return 0;
num = num || 1;
if( M == 0 ) return num;
return A(N-1,M-1,N * num);
};
//A排列
var C = function(N,M){
return A(N,M) / A(M,M);
};
//C组合 ,应该就这样了