int count(string s, char c) {
      	int freq = 0;
      	for (char curr : s) freq += (curr == c);
      	return freq;
      }
      
      Cpp language logo

      Count char frequency

      Count the frequency of character in the string

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.