<awangdev>1007. Minimum Domino Rotations For Equal Row_2.java
private int checkRotation(int[] A, int[] B, int candidate) {

        int rotationA = 0, rotationB = 0;
        for (int i = 0; i < A.length; i++) {
            if (A[i] != candidate && B[i] != candidate) return -1;
            else if (A[i] != candidate) rotationA++; 
            else if (B[i] != candidate) rotationB++;
        }
        return Math.min(rotationA, rotationB);
    }
private int sample_funcname ( int [ ] var_0 , int [ ] var_1 , int var_2 ) {
  int var_4 = 0 , var_5 = 0 ;
  for ( int var_6 = 0 ;
  var_6 < var_0 . length ;
  var_6 ++ ) {
    if ( var_0 [ var_6 ] != var_2 && var_1 [ var_6 ] != var_2 ) return - 1 ;
    else if ( var_0 [ var_6 ] != var_2 ) var_4 ++ ;
    else if ( var_1 [ var_6 ] != var_2 ) var_5 ++ ;
  }
  return Math . min ( var_4 , var_5 ) ;
}
