title: Change Bits Can Made One Flip
signature: func changeBitsCanMadeOneFlip(str string) bool {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual bool, expected bool) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(str string, expected bool) string {
      if validateSolution(PLACEHOLDER_FN_NAME(str),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver("00001", true)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver("0000", false)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver("11", false)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver("111110", true)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver("1", true)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver("111010111010", false)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver("hUInqJXNdbfP", false)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver("5191", false)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver("1110101101", false)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver("NupSrU xz", false)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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 );
  }