Subarray with sum closest to 0?

Правка en1, от el3el2, 2015-11-24 02:08:22

I am trying to find an O(n) solution to this problem:

Given an array, find the subarray with the sum closest to 0.

An O(nlogn) solution is kinda straightforward, but I have read this problem in a textbook in a context suggesting there's a O(n) solution. Any help?

Теги #algorithms, subarray

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский el3el2 2015-11-24 02:08:22 304 Initial revision (published)