Re: [algogeeks] Re: Solve it

2011-07-20 Thread Piyush Sinha
ya nitish above condition will do On 7/20/11, Nitish Garg nitishgarg1...@gmail.com wrote: I think: s[i] = max(s[i-2], s[i-2]+a[i], s[i-1], a[i]) should satisfy all the cases, even when all the numbers are negative. Pleas check. On Wed, Jul 20, 2011 at 12:44 AM, pnandy

Re: [algogeeks] Re: Solve it

2011-07-20 Thread Anisha Mazumder
do both s[i-2] and s[i-1] need to be checked? isn't by construction s[i-1]=s[i-2] ? what about s[i] = max( s[i-2]+a[i], s[i-1], a[i]) ? On Wed, Jul 20, 2011 at 3:48 AM, Piyush Sinha ecstasy.piy...@gmail.comwrote: ya nitish above condition will do On 7/20/11, Nitish Garg

[algogeeks] Re: Solve it

2011-07-19 Thread pnandy
On Jul 19, 8:00 pm, ankit sambyal ankitsamb...@gmail.com wrote: @Nitish and Shubam : Since we trying to find sub sequence and not a sub string, so if there are negative nos. in the array, just neglect them. Piyush's algo will work perfectly.. Piyush's algo won't work for -ve nos.

Re: [algogeeks] Re: Solve it

2011-07-19 Thread Nitish Garg
I think: s[i] = max(s[i-2], s[i-2]+a[i], s[i-1], a[i]) should satisfy all the cases, even when all the numbers are negative. Pleas check. On Wed, Jul 20, 2011 at 12:44 AM, pnandy sayantan.nand...@gmail.com wrote: On Jul 19, 8:00 pm, ankit sambyal ankitsamb...@gmail.com wrote: @Nitish and

[algogeeks] Re: solve the series

2011-06-10 Thread bittu
@sunny. ..lol..dude..20 June is My Bro's B'day 18th Nov is of My mom ...:P Shashank Computer Science Engg. Birla Institute of Technology, Mesra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: solve these puzzles.....very very urgent......thnx in advance

2010-12-12 Thread ADITYA KUMAR
ans for 1st one is 24 On Sat, Nov 27, 2010 at 3:12 PM, vamsi achyuth vamsiachy...@gmail.comwrote: these were the problems asked in tcs written exam. On 27 November 2010 15:08, srinivas reddy srinivaseev...@gmail.comwrote: @youngboy you have to choose one value for variable only