Ashish: the algorithm passes over string and check if there is any substring with len=1 is repeated or not. if not, tries for substring with len 2,... and so on. max length of substring which can be repeated can be at most N/2.
Regards, On Tue, Jun 5, 2012 at 10:48 AM, Ashish Goel <[email protected]> wrote: > The problem suggests that a character can't be more than once present and > thereby it can be done by just having s bitmap and if a char repeats, any > longer repeating substring will have those char repeated atleast twice, > hence O(n) solution. > > > Also, Hasaan: how is your algo O(n2) for for->while->for chain? > > Best Regards > Ashish Goel > "Think positive and find fuel in failure" > +919985813081 > +919966006652 > > > On Tue, Jun 5, 2012 at 11:42 AM, Ashish Goel <[email protected]> wrote: > >> Hassan, can you explain your algo? >> >> Best Regards >> Ashish Goel >> "Think positive and find fuel in failure" >> +919985813081 >> +919966006652 >> >> >> On Mon, Jun 4, 2012 at 11:20 AM, Hassan Monfared <[email protected]>wrote: >> >>> for >> >> >> > -- > 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.
