Growing phase
if ( not bool ( s ) ) : NEW_LINE INDENT dp [ i ] [ j ] [ s ] = arr [ i ] [ j ] + max_three ( maxScore ( arr , i + 1 , j , s ) , maxScore ( arr , i , j + 1 , s ) , maxScore ( arr , i - 1 , j , not bool ( s ) ) ) ; NEW_LINE DEDENT