jkpimp168 wrote:im scared of these kind of questions because i always worry that my counts would overlap. like in this question, while 7X can appear 10 times (70-79), how can X7 still appear 9 times (17,27, 37...97) as "77" is overlapped!? am i thinking too much?
ok thats the trick..
we are not being asked how many numbers..we are being asked how many times. so You gotta count those numbers twice:))
if you want to be on the safe side, try this:
numbers from 0-999 can be represented as XXX, 0<=x<=9
only one 7- like 7XX where x is any value from 0-9 except 7
3*9*9=243
two 7's=3*9=27. now each number contains two 7's. so total 7's=54:)
three 7's. only one number 777. But, three 7's
total 7's=243+54=3=300.