@Piyush, using stack i guess it can be done in O(n) On Tue, Jul 26, 2011 at 5:42 PM, Shikhar <[email protected]> wrote:
> @ankit: you are right...sorry about the error > > On Jul 26, 5:11 pm, ankit sambyal <[email protected]> wrote: > > The O/P of ur example should be 2,2,1,1,1,-1,-1 > > or am I getting it wrong ?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
