웅재의 코딩세상
[프로그래머스] 배열 만들기 5 본문
- 풀이
#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<string> intStrs, int k, int s, int l) {
vector<int> answer;
for(int i=0; i<intStrs.size(); i++){
string ss = intStrs[i].substr(s,l);
if(stoi(ss) > k) answer.push_back(stoi(ss));
}
return answer;
}
반응형
'코딩테스트 > 프로그래머스 - LV 0' 카테고리의 다른 글
[프로그래머스] 부분 문자열인지 확인하기 (0) | 2024.01.30 |
---|---|
[프로그래머스] 부분 문자열 이어 붙여 문자열 만들기 (0) | 2024.01.30 |
[프로그래머스] 접미사 배열 (0) | 2024.01.30 |
[프로그래머스] 문자열 여러 번 뒤집기 (0) | 2024.01.30 |
[프로그래머스] 9로 나눈 나머지 (0) | 2024.01.30 |