first-letter-to-appear-twice 1.0.0
First Letter to Appear Twice
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1#include <bits/stdc++.h>
2
3using namespace std;
4
6{
7public:
8 char repeatedCharacter(string s)
9 {
10 set<char> characters;
11 for (char c: s)
12 {
13 if (characters.find(c) != characters.end())
14 return c;
15 else
16 characters.insert(c);
17 }
18 return '\0';
19 }
20};
21
22int main()
23{
24
25 return 0;
26}
char repeatedCharacter(string s)
Definition main.cpp:8
int main()
Definition main.cpp:22