Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Maximum Sum Subarrays
Разница между en1 и en2, 61 символ(ов) изменены
<p>↵
Hello everyone,↵
</p>↵
<p>

I am trying to improve the time complexity of the following simple problem.↵

</p>↵
<p>↵
<b>
Problem:</b> Given an array A<b>A</b> consisting of N positive integers. For each K where (1 <= K <= N) find the largest sum sub array of size K. You just need to output the largest sum for each size K.↵
</p>↵
<pre>

Sample Input:↵
4↵
1 3 2 1↵

Sample Output:↵
3 5 6 7↵

</pre>↵
<p>

Any solution or idea better than O(N^2) is welcome. Any help will be appreciated.↵
</p>

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский NeverSayNever 2015-11-17 20:39:46 29
en3 Английский NeverSayNever 2015-11-17 20:38:33 9 Tiny change: ' an array <b>A</b> consistin' -> ' an array $A$ consistin'
en2 Английский NeverSayNever 2015-11-17 20:38:08 61
en1 Английский NeverSayNever 2015-11-17 20:35:53 454 Initial revision (published)