Posted On 2016-08-31
Answer Ans: 4001 There are 10000 numbers from 0 to 9999. If we consider each number as a 4 digit number, there are total 40000 digits. Since every digit has an equal probability of appearing, there will be 4000 1's (40000/10). Also the number 10000 has a '1' in it. Hence, total number of 1's are 4001. Another way is to use brute force ie count the 1's in single digit number, then in 2 digit number and so on.