Skip to content

Commit

Permalink
이슈 #363에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 21, 2024
1 parent 46ed0f2 commit 2af2826
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Programmers/한_번만_등장한_문자.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <string>
#include <vector>
#include <map>

using namespace std;

string solution(string s) {
map<char, int> map;
string answer = "";

for (char c : s) {
map[c]++;
}

for (const auto& it : map) {
if (it.second == 1) {
answer += it.first;
}
}

return answer;
}

0 comments on commit 2af2826

Please sign in to comment.