title: To find sum of all consecutive sub-array of length k in a given array
body: <p>I want to find out all the sum of continuous sub-array of length <code>K</code>
  for a given array of Length <code>n</code> given that <code>k &lt; n</code>. For example, let the given array be <code>arr[6]={1,2,3,4,5,6}</code> and <code>k=3</code>,then answer is <code>(6,9,12,15)</code>.
  It can be obtained as :</p>
  
  <pre><code>(1+2+3)=6,
  (2+3+4)=9,
  (3+4+5)=12,
  (4+5+6)=15.
  </code></pre>
  
  <p>I have tried this using sliding window of length <code>k</code>,but its time complexity is <code>O(n)</code>.Is any solution which takes even less time such as <code>O(log n)</code>.</p>