Me too didn't get Raghavan's algo... Pls explain.. It seems that above algo will find only longest sequence starting from index 0.
Just a thought: Along with raghavan's algo, what if I keep and array_of_integers[string_length] and keep on storing the count in this array. Once string is traversed we have to find the max distance among two equal numbers in an array. (need to think on this problem as well) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/gWwbzXZ_B1sJ. 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.