using System;
using System.Collections.Generic;
public class Solution {
public int[] solution(int[] num_list, int n) {
List<int> answer = new List<int>();
for(int i = 0; i < num_list.Length; i += n)
{
answer.Add(num_list[i]);
}
return answer.ToArray();
}
}
'프로그래머스 > Lv.0' 카테고리의 다른 글
[프로그래머스 C#] 접미사인지 확인하기 (0) | 2023.09.03 |
---|---|
[프로그래머스 C#] n 번째 원소부터 (0) | 2023.09.03 |
[프로그래머스 C#] n의 배수 고르기 (0) | 2023.09.03 |
[프로그래머스 C#] 제곱수 판별하기 (0) | 2023.09.03 |
[프로그래머스 C#] 369게임 (0) | 2023.09.03 |