limit. Count how many numbers from 1 to limit inclusive use at least one digit two or more times in their decimal form. The repeats do not have to be adjacent: 101 reuses the digit 1.
Checking every number up to limit will not do — there can be a billion of them.limit=30 → 2
Up to 30, only 11 and 22 repeat a digit.
limit=9 → 0
A one-digit number cannot repeat a digit.
limit=111 → 13
The nine numbers 11, 22, …, 99, plus four more: 100, 101, 110 and 111.
limit ≤ 10⁹limit=30
2
Run checks the first 3 tests in your browser. Submit checks all 58 tests on the server, hidden ones included.