el3el2's blog

By el3el2, history, 8 years ago, In English

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?

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it