title: Finding shortest combinations in array/sequence that equals sum
body: <p>I'm totally stuck and have no idea how to go about solving this. Let's say I've an array </p>
  
  <pre><code>arr = [1, 4, 5, 10]
  </code></pre>
  
  <p>and a number </p>
  
  <pre><code>n = 8
  </code></pre>
  
  <p>I need shortest sequence from within arr which equals n. So for example following sequences within arr equals n</p>
  
  <pre><code>c1 = 5,1,1,1
  c2 = 4,4
  c3= 1,1,1,1,1,1,1,1
  </code></pre>
  
  <p>So in above case, our answer is c2 because it's shortest sequences in arr that equals sum. </p>
  
  <p>I'm not sure what's the simplest way of finding a solution to above? Any ideas, or help will be really appreciated.</p>
  
  <p>Thanks!</p>
  
  <p>Edited:</p>
  
  <ul>
  <li>Fixed the array</li>
  <li>Array will possibly have postive values only.</li>
  <li>I'm not sure how subset problem fixes this, probably due to my own ignorance. Does sub-set algorithm always give the shortest sequence that equals sum? For example, will subset problem identify c2 as the answer in above scenario?</li>
  </ul>