728x90
https://school.programmers.co.kr/learn/courses/30/lessons/181920
소스코드
using System;
using System.Collections.Generic;
public class Solution
{
public int[] solution(int start, int end)
{
List<int> answer = new List<int>();
for (int i = start; i <= end; i++)
answer.Add(i);
return answer.ToArray();
// return Enumerable.Range(start, end - start + 1).ToArray(); //이것도가능
}
}
728x90
'코딩공부 > 프로그래머스' 카테고리의 다른 글
[프로그래머스]Lv.0 배열 만들기 4 C# (0) | 2023.06.02 |
---|---|
[프로그래머스]Lv.0 콜라츠 수열 만들기 C# (0) | 2023.06.02 |
[프로그래머스]Lv.0 배열 만들기 2 C# (0) | 2023.06.02 |
[프로그래머스]Lv.0 수열과 구간 쿼리 2 C# (0) | 2023.06.02 |
[프로그래머스]Lv.0 수열과 구간 쿼리 3 C# (0) | 2023.06.02 |