Find number of champ numbers between range x and y

Given range x and y you have to find number of champ numbers between these range

Champ numbers are:
numbers in which every digit is distinct
All digits are less than 5

Can anyone solve this question ???
X and y are large 10^9

1 Like
Hint

Realise that there is an upper bound on the largest possible champ number, and that it is pretty small. The largest possible champ number is 43210.

Thanks brother done!!

Actually I could not think before that champ numbers in range (1-10^9) is only 1650 in total so I should better generate them instead of checking all

1 Like