Just started my gre prep, can't figure out the logic in these type of questions

Q1. How many 1’s do you need to write numbers from 100 to 200?
Q2. The number of 8’s required to write all numbers from 259 to 492 is?

Is there any pattern or trick through which we can solve these type of questions?