Function to return the count of distinct ( N + M ) digit numbers having N 0 ' s ▁ and ▁ and ▁ M ▁ 1' s with no leading zeros
function findPermutation ( $ N , $ M ) { $ permutation = factorial ( $ N + $ M - 1 ) / ( factorial ( $ N ) * factorial ( $ M - 1 ) ) ; return $ permutation ; }