Approach hintTry it first, then revealHide
Numbers written only with digits 0 and 1 are rare; generate them recursively by appending 0 or 1 to a prefix that starts at 1, and count those not exceeding n.
Numbers written only with digits 0 and 1 are rare; generate them recursively by appending 0 or 1 to a prefix that starts at 1, and count those not exceeding n.