Numbers With Repeated Digits
Count the numbers up to n whose digits are all distinct, walking the digits of n and multiplying out the free positions, then subtract from n.
Count the numbers up to n whose digits are all distinct, walking the digits of n and multiplying out the free positions, then subtract from n.