<awangdev>921. Minimum Add to Make Parentheses Valid_2.java
public int minAddToMakeValid(String s) {
        if (s == null || s.length() == 0) {
            return 0;
        }
        int count = 0, openCount = 0;
        for (char c : s.toCharArray()) {
            if (c == '(') openCount++;
            else if (openCount == 0) count++;
            else openCount--;
        }
        return count + openCount;
    }
public int sample_funcname ( String var_1 ) {
  if ( var_1 == null || var_1 . length ( ) == 0 ) {
    return 0 ;
  }
  int var_5 = 0 , var_6 = 0 ;
  for ( char var_8 : var_1 . toCharArray ( ) ) {
    if ( var_8 == '(' ) var_6 ++ ;
    else if ( var_6 == 0 ) var_5 ++ ;
    else var_6 -- ;
  }
  return var_5 + var_6 ;
}
