Else find the length .
arr = [ 0 ] * MAX NEW_LINE for i in range ( n ) : NEW_LINE INDENT arr [ i ] = 1 if s [ i ] == '0' else - 1 NEW_LINE DEDENT dp = [ [ - 1 ] * 3 for _ in range ( MAX ) ] NEW_LINE return findlength ( arr , s , n , 0 , 0 , dp ) NEW_LINE