title: Count the number of occurrences of 0's in integers from 1 to N
body: <p>How will you efficiently count number of occurrences of 0's in the decimal representation of integers from 1 to N?</p>
  
  <pre><code>e.g. The number of 0's from 1 to 105 is 16. How?
  
  10,20,30,40,50,60,70,80,90,100,101,102,103,104,105    
  </code></pre>
  
  <p>Count the number of 0's &amp; you will find it 16.</p>
  
  <p>Obviously, a brute force approach won't be appreciated. You have to come up with an approach which doesn't depend on "How many numbers fall between 1 to N".
  Can we just do by seeing some kind of pattern?</p>
  
  <p>Cannot we extend the <a href="http://www.geeksforgeeks.org/archives/22180" rel="noreferrer">logic compiled here</a> to work for this problem?</p>