How can i find LCS (longest common substring) among two or more strings using trie ?
I have an idea like this - suppose my first string is "abbcabdd". then i will first insert "abbcabdd" in trie ,then "bbcabdd", then "bcabdd" .... , then "d" and repeat this process for every string .
Then calculate the longest substring by traversing the trie.
but i think it is not efficient. Is there any other improved method ?