title: Ways Remove One Element Binary String Xor Becomes Zero
signature: class Solution {
  
      public Integer waysRemoveOneElementBinaryStringXorBecomesZero(String str) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(String str, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(str,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution("KfcTJNP", 7);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution("05312505872", 1);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution("100111", 2);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution("tDEEhKxrQ", 9);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution("50824233019", 1);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution("10001110010", 5);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution("T SEZaNm MYQ", 12);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution("838415739", 1);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution("01110100", 4);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution("WYQiAey H", 9);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(String str, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(str),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def ways_remove_one_element_binary_string_xor_becomes_zero(str):
      one_count = 0
      zero_count = 0
      n = len(str)
      for i in range(0, n, 1):
          if (str[i] == '1'):
              one_count += 1
          else:
              zero_count += 1
      if ((one_count % 2) == 0):
          return zero_count
      return one_count
source_cpp: int ways_remove_one_element_binary_string_xor_becomes_zero(string str) {
    int one_count = 0, zero_count = 0;
    int n = str . length ( );
    for ( int i = 0;
    i < n;
    i ++ ) if ( str [ i ] == '1' ) one_count ++;
    else zero_count ++;
    if ( one_count % 2 == 0 ) return zero_count;
    return one_count;
  }