Level 0. 배열 만들기 5
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<int> solution(vector<string> intStrs, int k, int s, int l)
{
vector<int> answer;
for (string& str : intStrs)
{
int num = stoi(str.substr(s, l));
if (k < num)
answer.emplace_back(num);
}
return answer;
}
'자료구조 & 알고리즘 > 프로그래머스' 카테고리의 다른 글
Level 0. 조건 문자열 (0) | 2023.05.27 |
---|---|
Level 0. 1로 만들기 (0) | 2023.05.26 |
Level 0. 문자 개수 세기 (0) | 2023.05.24 |
Level 2. 연속된 부분 수열의 합 (0) | 2023.05.23 |
Level 0. 문자열 잘라서 정렬하기 (0) | 2023.05.22 |