title: Coin change recursive algorithm unwinding
body: <p>I am trying to <code>unwind</code> the <code>recursive</code> function in this <code>algorithm</code>. Coin change problem: Given a target amount n and a list <code>array</code> of distinct coin values, what's the fewest coins needed to make the change amount.</p>
  
  <pre><code>def rec_coin(target,coins):
  
      # Default to target value
      min_coins = target
  
      # Check to see if we have a single coin match (BASE CASE)
      if target in coins:
          return 1
  
      else:
  
          # for every coin value that is &lt;= than target
          for i in [c for c in coins if c &lt;= target]:
  
              # Recursive Call (add a count coin and subtract from the target) 
              num_coins = 1 + rec_coin(target-i,coins)
  
              # Reset Minimum if we have a new minimum
              if num_coins &lt; min_coins:
  
                  min_coins = num_coins
  
      return min_coins
  
  # rec_coin(63,[1,5,10,25])
  # 6
  </code></pre>
  
  <p>This is what I come up with after breaking it apart</p>
  
  <pre><code>1 + 63-1 coins + 62-1 + 61-1 and so on..
  </code></pre>
  
  <p>why do we need to add 1? What would be the correct way of unwiding the recursion</p>