728x90
반응형
SMALL
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(string my_string) {
vector<int> answer;
for(char str : my_string){
if(str >= '0' && str <='9')
answer.push_back(int(str)-'0');
}
sort(answer.begin(),answer.end());
return answer;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
[프로그래머스] 최댓값 만들기 (2) (0) | 2025.09.05 |
---|---|
[프로그래머스] 숨어있는 숫자의 덧셈 (1) (0) | 2025.09.05 |
[프로그래머스] 주사위의 개수 (0) | 2025.09.05 |
[프로그래머스] 가위 바위 보 (0) | 2025.09.05 |
[프로그래머스] 개미 군단 (0) | 2025.09.05 |
댓글