Skip to content

Commit

Permalink
이슈 #357에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 21, 2024
1 parent 6ac3836 commit 6d4ceb0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Programmers/중복된_문자_제거.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <string>
#include <vector>
#include <unordered_set>

using namespace std;

string solution(string my_string) {
unordered_set<char> set;
string answer = "";

for (char c : my_string) {
if (set.find(c) == set.end()) {
set.insert(c);
answer += c;
}
}

return answer;
}

0 comments on commit 6d4ceb0

Please sign in to comment.