title: Coin Change (Dynamic Programming)
body: <p>We usually the following recurrence relation for the coin change problem:
  (<code>P</code> is the total money for which we need change and <code>d_i</code> is the coin available)
  <img src="https://i.stack.imgur.com/U1C3x.png" alt=""></p>
  
  <p>But can't we make it like this:
  (<code>V</code> is the given sorted set of coins available, <code>i</code> and <code>j</code> are its subscripts with <code>Vj</code> being the highest value coin given) </p>
  
  <pre><code>C[p,Vi,j] = C[p,Vi,j-1]     if Vj &gt; p
            = C[p-Vj,Vi,j] + 1  if Vj &lt;=p
  </code></pre>
  
  <p>Is there anything wrong with what I wrote? Though the solution is not dynamic but isn't it more efficient? </p>