checking for sub - string from ith index to jth index iff str . charAt ( i + 1 ) to str . charAt ( j - 1 ) is a palindrome
if ( table [ i + 1 ] [ j - 1 ] && str . charAt ( i ) == str . charAt ( j ) ) { table [ i ] [ j ] = true ; if ( k > maxLength ) { start = i ; maxLength = k ; } } } } System . out . print ( " Longest ▁ palindrome ▁ substring ▁ is ; ▁ " ) ; printSubStr ( str , start , start + maxLength - 1 ) ;