title: Change Bits Can Made One Flip
signature: function changeBitsCanMadeOneFlip(str) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(str, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(str),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver("00001", true);
    console.log(`TEST-0...${result}`);
  
    result = driver("0000", false);
    console.log(`TEST-1...${result}`);
  
    result = driver("11", false);
    console.log(`TEST-2...${result}`);
  
    result = driver("111110", true);
    console.log(`TEST-3...${result}`);
  
    result = driver("1", true);
    console.log(`TEST-4...${result}`);
  
    result = driver("111010111010", false);
    console.log(`TEST-5...${result}`);
  
    result = driver("hUInqJXNdbfP", false);
    console.log(`TEST-6...${result}`);
  
    result = driver("5191", false);
    console.log(`TEST-7...${result}`);
  
    result = driver("1110101101", false);
    console.log(`TEST-8...${result}`);
  
    result = driver("NupSrU xz", false);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
source_py: def change_bits_can_made_one_flip(str):
      zeros = 0
      ones = 0
      for i in range(0, len(str)):
          ch = str[i]
          if (ch == '0'):
              zeros = (zeros + 1)
          else:
              ones = (ones + 1)
      return ((zeros == 1) or (ones == 1))
source_cpp: bool change_bits_can_made_one_flip(string str) {
    int zeros = 0, ones = 0;
    for ( char ch : str ) ( ch == '0' ) ? ++ zeros : ++ ones;
    return ( zeros == 1 || ones == 1 );
  }