Hi Mac, Problem Have Discussed Several Time across various forums ,here one
of the possible solution using Suffix Array in O(N^2)
http://shashank7s.blogspot.com/2011/06/longest-repeated-substring-eg-maximum.html
Hope it will be helpful, let me know for if any test case its not working or
any
Thanks for your blog post, *Shashank Mani * :)
On Fri, Aug 19, 2011 at 2:42 PM, WgpShashank shashank7andr...@gmail.comwrote:
Hi Mac, Problem Have Discussed Several Time across various forums ,here one
of the possible solution using Suffix Array in O(N^2)
O(n^2) i guess..
We can save all possible substrings..(in two loops it can be done) in
a hash map..as key..and the value as COUNT..then we can..search for
the most occurring substring!!
u said for non - efficient ;)
On Aug 18, 6:07 pm, MAC macatad...@gmail.com wrote:
A string can have many
suffix tree is obvsly best..but hard to code at interview!!
On Aug 18, 7:20 pm, DheerajSharma dheerajsharma1...@gmail.com wrote:
O(n^2) i guess..
We can save all possible substrings..(in two loops it can be done) in
a hash map..as key..and the value as COUNT..then we can..search for
the most
am just asking but how can u get all possible substrings in O(n square) time
when there are 2 power N of them actually?
On Thu, Aug 18, 2011 at 4:20 PM, DheerajSharma
dheerajsharma1...@gmail.comwrote:
O(n^2) i guess..
We can save all possible substrings..(in two loops it can be done) in
a
substrings and subsets are two different things.
If you want an easy solution brute force it...:)
Its not that difficult to code a suffix tree if it makes you a
millionare:)
On Thu, Aug 18, 2011 at 7:59 PM, Arun Vishwanathan
aaron.nar...@gmail.comwrote:
am just asking but how can u get