title: Change Bits Can Made One Flip
signature: class Solution {
  
      public Boolean changeBitsCanMadeOneFlip(String str) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(String str, Boolean expected){
          try{
              Driver driver = new Driver();
              if (driver.run(str,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution("00001", true);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution("0000", false);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution("11", false);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution("111110", true);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution("1", true);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution("111010111010", false);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution("hUInqJXNdbfP", false);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution("5191", false);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution("1110101101", false);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution("NupSrU xz", false);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(String str, Boolean expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(str),expected);
      }
      
      public boolean validateSolution(Boolean actual, Boolean expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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 );
  }