There are 10 numbers with 7 in the ones digit, i.e., 7, 17, 27, 37, 47, 57, 67, 77, 87, 97.
There are 10 numbers with 7 in the tens digit, i.e., 70, 71, 72, 73, 74, 75, 76, 77, 78, 79.
So, among the numbers 1-100, digit ‘7’ occur 20 times.
Similarly, from 101-200, 20 times digit ‘7’ occur.
201-300, 20 times digit ‘7’ occur.
301-400, 20 times digit ‘7’ occur.
401-500, 20 times digit ‘7’ occur.
501-600, 20 times digit ‘7’ occur.
601-700, 21 times digit ‘7’ occur.
801-900, 20 times digit ‘7’ occur.
901-1000, 20 times digit ‘7’ occur.
Now, from 701-800,
At hundred place of these 3 digit numbers, 7 will come 100 times.
At tens place 7 will come 10 times, i.e., 770, 771, 772, 773, 774, 775, 775, 777, 778, 779.
At units place 7 will come 10 times, i.e., 707, 717, 727, 737, 747, 757, 767, 777, 787, 797.
So, total number of times digit ‘7’ occurs from 701 – 800 = 100 + 10 + 10 = 120
By adding all, we get 20 × 8 + 120 + 21 = 301