FunctionRacerProblemsRace

Count Numbers With Unique Digits

MediumMathPython, JavaScript, TypeScript, Java, C++

Return how many whole numbers x with 0 <= x < 10**n have no repeated digit (for example 11 and 101 repeat a digit, 102 does not).

Example 1

n 2
returns 91

0 to 99 except 11, 22, ..., 99: 91 numbers.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems