[프로그래머스 | Lv.0] 배열 자르기

이승민·2023년 7월 26일
0

프로그래머스

목록 보기
11/27

https://school.programmers.co.kr/learn/courses/30/lessons/120833?language=csharp

📝 나의 풀이

using System;
using System.Collections.Generic;

public class Solution {
    public int[] solution(int[] numbers, int num1, int num2) {
        List<int> list = new List<int>();
        
        
        for(int i = num1; i <= num2; i++)
        {
            list.Add(numbers[i]);
        }        
        int[] answer = list.ToArray();
        
        return answer;
    }
}

0개의 댓글

관련 채용 정보