[buug] substring of integers problem
khogoboom at gmail.com
Tue Feb 8 09:04:45 PST 2011
> That's an interesting problem too, but I don't think it is relevant to
> mine :-P I must have not explained it clearly, so I'll do it again
> here. Apologies to those who have already seen this.
> The problem is: given a list (array, finite sequence, vector - whatever
> you want to call it) of integers, positive and negative, find a slice
> (contiguous subsequence) which maximizes the *sum* of the integers in
> the slice.
I think the Knuth-Morris-Pratt Algorithm would be best to solve this. I
don't have time still to think this through.
Remind me to let you draw on my paper next time.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the buug