14. Permutations

Easy

Use a permutation when order matters and repetition is not allowed:

nPr=n!(nr)!_nP_r = \frac{n!}{(n-r)!}

Return the number of ways to fill r distinct ordered roles from n people.

solve(12, 3)  ->  1320     # president, VP, secretary from 12 students

Sign in to write and run your own code.

Implement solve(...)