global sign is positive ( we use different values in two calls of functions so that we finally check if all vector elements are 0.
if ( stk . top ( ) ) v [ s [ i ] - ' a ' ] += ( adjSign ( s , i ) ? add ? 1 : -1 : add ? -1 : 1 ) ;