Problem Statement
Given an int n find all positive integers less than n whose digits are all different. Return the total number of such integers.
Definition
- Class:
- UniqueDigits
- Method:
- count
- Parameters:
- int
- Returns:
- int
- Method signature:
- int count(int n)
- (be sure your method is public)
Constraints
- n will be between 1 and 10000 inclusive.
Examples
21
Returns: 19
We count all integers between 1 and 20, except 11.101
Returns: 90
1001
Returns: 738
1
Returns: 0