Else find the length .
var arr = Array ( MAX ) . fill ( 0 ) ; for ( var i = 0 ; i < n ; i ++ ) arr [ i ] = ( s [ i ] == ' ' ? 1 : - 1 ) ; var dp = Array . from ( Array ( MAX ) , ( ) => Array ( 3 ) . fill ( - 1 ) ) ; return findlength ( arr , s , n , 0 , 0 , dp ) ; }