Hassan geke should not be a valid string. The question states " which have the same substring following it " so here e follows e. There is no precondition that it has to follow immediate.
Utsav: can you clarify? Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Tue, Jun 5, 2012 at 11:32 PM, Hassan Monfared <hmonfa...@gmail.com>wrote: > yes It's valid, cuz it doesn't have any repeated substring next together > > > On Tue, Jun 5, 2012 at 7:08 PM, Lomash Goyal <lomesh.go...@gmail.com>wrote: > >> is geke is a invalid strng? >> >> >> On Tue, Jun 5, 2012 at 12:17 PM, Hassan Monfared <hmonfa...@gmail.com>wrote: >> >>> 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 <ashg...@gmail.com> 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 <ashg...@gmail.com> 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 >>>>> <hmonfa...@gmail.com>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 algogeeks@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> algogeeks+unsubscr...@googlegroups.com. >>>> 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 algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> Regards >> >> Lomash Goyal >> >> * >> * >> >> >> -- >> 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 >> algogeeks+unsubscr...@googlegroups.com. >> 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 algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > 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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.