title: Program Count Occurrence Given Character String
signature: function programCountOccurrenceGivenCharacterString($s, $c) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($s, $c, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($s, $c), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        "mhjnKfd", 'l', 
        0));
      
      printf("TEST-1...%s\n",driver(
        "716662107", '6', 
        3));
      
      printf("TEST-2...%s\n",driver(
        "01", '1', 
        1));
      
      printf("TEST-3...%s\n",driver(
        "wPHSxIbnHakGRO", 'n', 
        1));
      
      printf("TEST-4...%s\n",driver(
        "721106", '8', 
        0));
      
      printf("TEST-5...%s\n",driver(
        "111", '0', 
        0));
      
      printf("TEST-6...%s\n",driver(
        "TIBFU", 'Q', 
        0));
      
      printf("TEST-7...%s\n",driver(
        "0", '3', 
        0));
      
      printf("TEST-8...%s\n",driver(
        "10", '0', 
        1));
      
      printf("TEST-9...%s\n",driver(
        "lqq", 'd', 
        0));
      
  }
  
  main();
  ?>
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;
  }