title: Random integers in array. Find the greatest sum of a continuous subset
body: <p>I had an interview question a while back that I never got a solution for. Apparently there is a "very efficient" algorithm to solve it. </p>
  
  <p>The question: Given an array of random positive and negative numbers, find the continuous subset that has the greatest sum. </p>
  
  <p>Example:</p>
  
  <p><code>[1, -7, 4, 5, -1, 5]</code></p>
  
  <p>The best subset here is <code>{4, 5, -1, 5}</code></p>
  
  <p>I can think of no solution but the brute-force method. What is the efficient method?  </p>