title: Change Bits Can Made One Flip
signature: function change_bits_can_made_one_flip(str)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(str, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(str), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver("00001", true);
      @printf("TEST-0...%s\n",result);
      
      result = driver("0000", false);
      @printf("TEST-1...%s\n",result);
      
      result = driver("11", false);
      @printf("TEST-2...%s\n",result);
      
      result = driver("111110", true);
      @printf("TEST-3...%s\n",result);
      
      result = driver("1", true);
      @printf("TEST-4...%s\n",result);
      
      result = driver("111010111010", false);
      @printf("TEST-5...%s\n",result);
      
      result = driver("hUInqJXNdbfP", false);
      @printf("TEST-6...%s\n",result);
      
      result = driver("5191", false);
      @printf("TEST-7...%s\n",result);
      
      result = driver("1110101101", false);
      @printf("TEST-8...%s\n",result);
      
      result = driver("NupSrU xz", false);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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 );
  }