title: Change Bits Can Made One Flip
signature: fun changeBitsCanMadeOneFlip(str: String): Boolean {
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 );
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"str": "00001"}}, {"idx": 1, "outputs": false, "inputs": {"str": "0000"}}, {"idx": 2, "outputs": false, "inputs": {"str": "11"}}, {"idx": 3, "outputs": true, "inputs": {"str": "111110"}}, {"idx": 4, "outputs": true, "inputs": {"str": "1"}}, {"idx": 5, "outputs": false, "inputs": {"str": "111010111010"}}, {"idx": 6, "outputs": false, "inputs": {"str": "hUInqJXNdbfP"}}, {"idx": 7, "outputs": false, "inputs": {"str": "5191"}}, {"idx": 8, "outputs": false, "inputs": {"str": "1110101101"}}, {"idx": 9, "outputs": false, "inputs": {"str": "NupSrU xz"}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(str: String, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(str), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("00001", true)
      println("TEST-0...${result}")
      
      result = driver("0000", false)
      println("TEST-1...${result}")
      
      result = driver("11", false)
      println("TEST-2...${result}")
      
      result = driver("111110", true)
      println("TEST-3...${result}")
      
      result = driver("1", true)
      println("TEST-4...${result}")
      
      result = driver("111010111010", false)
      println("TEST-5...${result}")
      
      result = driver("hUInqJXNdbfP", false)
      println("TEST-6...${result}")
      
      result = driver("5191", false)
      println("TEST-7...${result}")
      
      result = driver("1110101101", false)
      println("TEST-8...${result}")
      
      result = driver("NupSrU xz", false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: changeBitsCanMadeOneFlip
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn