Distinct palindromic sub strings

I want to calculate number of DISTINCT palindromic substrings in a string.How to do it?
Like if aba is string the their are 3 distinct palindromic subsrings:{a,aba,b}
length of string could be 10^5 range.So i dont think O(n^2) solution will work.I want a algorithm to do this in less than O(n^2).

Questions by justacoder

Showing Answers 1 - 1 of 1 Answers

Eric Nantel

  • Apr 22nd, 2015
 

Code
  1. /*something like this*//*there is probably mistake or a better way to do it for sure , but start with this*/

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions