Given an integer n, return the count of positive integers in the range [1,n][1, n][1,n] that contain at least one repeated digit.
n
Constraints:
1≤n≤1091 \le n \le 10^91≤n≤109
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Numbers With Repeated Digits
What is the count of positive integers containing at least one repeated digit when the input is 1?
1
(0)
(1)
(2)
(10)
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Implement your solution in the following coding playground.