title: Change Bits Can Made One Flip
signature: function changeBitsCanMadeOneFlip($str) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($str, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($str), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        "00001", 
        true));
      
      printf("TEST-1...%s\n",driver(
        "0000", 
        false));
      
      printf("TEST-2...%s\n",driver(
        "11", 
        false));
      
      printf("TEST-3...%s\n",driver(
        "111110", 
        true));
      
      printf("TEST-4...%s\n",driver(
        "1", 
        true));
      
      printf("TEST-5...%s\n",driver(
        "111010111010", 
        false));
      
      printf("TEST-6...%s\n",driver(
        "hUInqJXNdbfP", 
        false));
      
      printf("TEST-7...%s\n",driver(
        "5191", 
        false));
      
      printf("TEST-8...%s\n",driver(
        "1110101101", 
        false));
      
      printf("TEST-9...%s\n",driver(
        "NupSrU xz", 
        false));
      
  }
  
  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 );
  }