If n is odd , string cannot be balanced
if ( n % 2 == 1 ) : NEW_LINE INDENT return 0 NEW_LINE DEDENT dp = [ [ - 1 for i in range ( MAX ) ] for i in range ( MAX ) ] NEW_LINE return countRec ( 0 , n - 1 , dp , st ) NEW_LINE