title: Program Count Occurrence Given Character String
signature: class Solution {
  
      public Integer programCountOccurrenceGivenCharacterString(String s, Character c) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(String s, Character c, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(s, c,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution("mhjnKfd", 'l', 0);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution("716662107", '6', 3);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution("01", '1', 1);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution("wPHSxIbnHakGRO", 'n', 1);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution("721106", '8', 0);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution("111", '0', 0);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution("TIBFU", 'Q', 0);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution("0", '3', 0);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution("10", '0', 1);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution("lqq", 'd', 0);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(String s, Character c, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(s, c),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def program_count_occurrence_given_character_string(s, c):
      res = 0
      for i in range(len(s)):
          if (s[i] == c):
              res = (res + 1)
      return res
source_cpp: int program_count_occurrence_given_character_string(string s, char c) {
    int res = 0;
    for ( int i = 0;
    i < s . length ( );
    i ++ ) if ( s [ i ] == c ) res ++;
    return res;
  }