If it would have been L consecutive it would be a peice of cake :) it is at least L consecutive, so you can have even whole array as the solution, but that may not be the correct answer.
Eg:- 2,-4,6,-1,-4,56,-3,5,7,9 and L is 3 then, soln is: 56,-3,5,7,9. Now did you get it? manu jose wrote: > Is it atleast L consecutive or L consecutive ??? > > On 3/20/06, vb <[EMAIL PROTECTED]> wrote: > > > > > > Hi all, > > > > How can we find the the maximum sum of atleast L consecutive integers > > given a sequence of N integers. > > > > The brute force approach of forming all possible length sequences at > > every index and finding their sum gives an O(N^2) solution which is not > > desirable. > > > > Can somebody tell me a better approach for this ? > > > > > > > > > > > -- > Manu Jose, > mob :09844467453 > E-mail : [EMAIL PROTECTED] > ------------------------------------------------- > > ------=_Part_2153_13336438.1142859933468 > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable > X-Google-AttachSize: 855 > > Is it <span style="background-color: rgb(255, 255, 51);">atleast L > consecutive </span>or L consecutive ??? <br><br><div><span > class="gmail_quote">On 3/20/06, <b class="gmail_sendername">vb</b> <<a > href="mailto:[EMAIL PROTECTED]"> > [EMAIL PROTECTED]</a>> wrote:</span><blockquote class="gmail_quote" > style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; > padding-left: 1ex;"><br>Hi all,<br><br>How can we find the the maximum sum of > atleast L consecutive integers > <br>given a sequence of N integers.<br><br>The brute force approach of > forming all possible length sequences at<br>every index and finding their sum > gives an O(N^2) solution which is not<br>desirable.<br><br>Can somebody tell > me a better approach for this ? > [EMAIL PROTECTED]</a><br>------------------------------------------------- > > ------=_Part_2153_13336438.1142859933468-- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---