<gouthampradhan>math_SolveTheEquation_1.java
private int[] calculate(String num, boolean isNeg, int xSum, int rest) {
    int[] A = new int[2];
    if (num.contains("x")) {
      num = num.substring(0, num.length() - 1);
      if (isNeg) {
        xSum -= num.isEmpty() ? 1 : Integer.parseInt(num);
      } else {
        xSum += num.isEmpty() ? 1 : Integer.parseInt(num);
      }
    } else {
      if (isNeg) {
        rest -= Integer.parseInt(num);
      } else {
        rest += Integer.parseInt(num);
      }
    }
    A[0] = xSum;
    A[1] = rest;
    return A;
  }
private int [ ] sample_funcname ( String var_1 , boolean var_3 , int var_4 , int var_5 ) {
  int [ ] var_7 = new int [ 2 ] ;
  if ( var_1 . contains ( "x" ) ) {
    var_1 = var_1 . substring ( 0 , var_1 . length ( ) - 1 ) ;
    if ( var_3 ) {
      var_4 -= var_1 . isEmpty ( ) ? 1 : Integer . parseInt ( var_1 ) ;
    }
    else {
      var_4 += var_1 . isEmpty ( ) ? 1 : Integer . parseInt ( var_1 ) ;
    }
  }
  else {
    if ( var_3 ) {
      var_5 -= Integer . parseInt ( var_1 ) ;
    }
    else {
      var_5 += Integer . parseInt ( var_1 ) ;
    }
  }
  var_7 [ 0 ] = var_4 ;
  var_7 [ 1 ] = var_5 ;
  return var_7 ;
}
