how to find distinct digit set numbers over a range of integers?
- by evil.coder
Suppose i have a unsigned integer, call it low and one another call it high such that highlow.
The problem is to find distinct digit set numbers over this range.
For example, suppose low is 1 and high is 20 then the answer is 20, because all the numbers in this range are of distinct digit sets. If suppose low is 1 and high is 21, then the answer is 20, because 12 and 21 have same digit set i.e.1, 2. I am not looking for a bruteforce algo., if anyone has a better solution then a usual bruteforce approach, please tell..