Submitted Questions

  • 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).

    Eric Nantel

    • Apr 22nd, 2015

    "cpp /*something like this*/ bool isPalin = true; const char* msg; char* ptr_1 , ptr_2; ptr_1 = msg; unsigned int size = ARRAYSIZE(msg); ptr_2 = msg + (size - 1); auto sub; ...