프로그래머스 181888 n개 간격의 원소들

1 개요[ | ]

프로그래머스 181888 n개 간격의 원소들

2 C++[ | ]

#include <string>
#include <vector>

using namespace std;

vector<int> solution(vector<int> num_list, int n) {
    vector<int> answer;
    for(int i=0; i<num_list.size(); i+=n) {
        answer.push_back(num_list[i]);
    }
    return answer;
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}