Repeated Characters
Lesson 16 of 18 in Coddy's Functions in C++: Building Your Own Functions course.
Challenge
MediumWrite a function to find repeated characters in two strings.
The function find_repeated_characters takes two strings and returns all the characters that are repeated in both strings.
Example:
- Input 1:
"coddy" - Input 2:
"code" - Output:
"cod"
Try it yourself
#include <iostream>
#include <unordered_map>
using namespace std;
void findRepeatedChars(string str1, string str2) {
}All lessons in Functions in C++: Building Your Own Functions
1Introduction
Introduction2Beginner-level function
Repeat a StringReverse a StringMax ValueFill stringCenter TextFormat TextMath Operation