C ++ program for the above approach
#include <bits/stdc++.h> NEW_LINE using namespace std ; int freqCount ( string str , char k ) { int count = 0 ; for ( int i = 0 ; i < str . size ( ) ; i ++ ) { if ( str [ i ] == k ) count ++ ; } return count ; }