As he said, m
represents the current size of P
and n
represents the size of S
, in each recursive call you remove a number from S
and add it to P
, thus the size of your current permutation is increased by 1 (m+1
) and the number of available numbers to add to the permutation is decreased by 1 (n-1
)
Note that it is multiplied by n
as you perform this action for each number in S
.