title: How to count numbers between 2 numbers L and R (both included) such that product of the digits of the selected numbers is even?
body: <p>How to find the count of numbers between 2 numbers L and R (both included) which have product of their digits even?
  How can we go about it other than brute force?</p>
  
  <pre><code>dp[0][0]=4;
  dp[0][1]=5;
  for(int l=1;l&lt;=9;l++)
  {
      dp[l][0]=0;
      dp[l][1]=0;
      dp[l][0]+=(dp[l-1][0])*10;
      dp[l][0]+=dp[l-1][1]*5;
      dp[l][1]+=dp[l-1][1]*5;          
  }
  </code></pre>
  
  <p>Here is a brute force checker I had made,I am trying to develop a more efficient solution</p>
  
  <pre><code>bool f(ll n)
  {
    ll p=1;
    if(n==0)
    return true;
    while(n)
    {
       p*=n%10;
       n/=10;
       if(p%2==0) return true;
       p=1;
    }
    if(p%2) return false;
    else
    return true;
  }
  ll brute(ll l,ll r)
  {
     if(l&gt;r) swap(l,r);
      ll cnt=0;
     for(ll  i=l;i&lt;=r;i++)
     {
        if(f(i))
        {
           cnt++;
        }
     }
  
  return cnt;
  </code></pre>
  
  <p>}</p>
  
  <p><code>dp[l-1][0]</code> stores count of even product numbers of length l 
  That is what I had thought..?
  Can this solve the problem
  ?</p>