inblog logo
|
goho
    알고리즘문제풀기

    [프로그래머스/JAVA]배열 자르기

    gov's avatar
    gov
    Nov 28, 2024
    [프로그래머스/JAVA]배열 자르기
    Contents
    문제풀이

    문제

    notion image

    풀이

    class Solution { public int[] solution(int[] numbers, int num1, int num2) { int[] answer = new int[num2 - num1 +1]; for(int i = num1; i <= num2; i++) { answer[i-num1] = numbers[i]; } return answer; } }
    Share article

    goho

    RSS·Powered by Inblog