Skip to content

Commit

Permalink
이슈 #352에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 21, 2024
1 parent 4ca0def commit aa6f7ae
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Programmers/문자열_정렬하기_1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

vector<int> solution(string my_string) {
vector<int> answer;
for (char c : my_string) {
if (isdigit(c)) {
answer.push_back(c - '0');
}
}

sort(answer.begin(), answer.end());
return answer;
}

0 comments on commit aa6f7ae

Please sign in to comment.