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
3
using namespace
std;
4
5
class
Solution
6
{
7
public
:
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
22
int
main
()
23
{
24
25
return
0;
26
}
Solution
Definition
main.cpp:6
Solution::repeatedCharacter
char repeatedCharacter(string s)
Definition
main.cpp:8
main
int main()
Definition
main.cpp:22
main.cpp
Generated by
1.9.8