We have to count the numbers up to N(N can be up to 10^17) such that the digits from the smallest possible permutation ↵
forEexample if I take N=13 then the answer would be 12 since 10 is not the smallest ↵
permutation of the digits '0' and '1'.
for
permutation of the digits '0' and '1'.