Menu
Coddy logo textTech

Repeated in Array

Lesson 18 of 18 in Coddy's Functions in C++: Building Your Own Functions course.

challenge icon

Challenge

Hard

Write a function to find the most repeated characters in an array.


The function will take an array and return the characters that are repeated the most.

Example:

  • Input: {'a', 'b', 'c', 'a', 'b', 'a', 'c', 'c', 'c', 'b', 'b'}
  • Output: "b c"

Try it yourself

#include <iostream>
#include <vector>

 
vector<char> findMostRepeatedChars(vector<char> input) {
 
}

All lessons in Functions in C++: Building Your Own Functions