Store palindromes of size 2
for i in range ( len ( s ) - 1 ) : NEW_LINE INDENT if ( s [ i ] == s [ i + 1 ] ) : NEW_LINE INDENT dp [ i ] [ i + 1 ] = 1 ; NEW_LINE m [ s [ i : i + 2 ] ] = 1 ; NEW_LINE DEDENT DEDENT