nPr function

BigInt nPr(
  1. int n,
  2. int r
)

Calculates the number of permutations of r items taken from n.

Implementation

BigInt nPr(int n, int r) => factorial(n) ~/ factorial(n - r);