count of no of signs
int a = 0 , b = 0 ; for ( int i = 0 ; i < A . length ( ) ; i ++ ) { if ( A . charAt ( i ) == ' ( ' && A . charAt ( i + 2 ) == ' ) ' ) return true ; if ( A . charAt ( i ) == ' * ' || A . charAt ( i ) == ' + ' || A . charAt ( i ) == ' - ' || A . charAt ( i ) == ' / ' ) a ++ ; if ( A . charAt ( i ) == ' ( ' ) b ++ ; } if ( b > a ) return true ; return false ; }