[Java] 프로그래머스 - 배열 뒤집기

박철현·2023년 3월 7일

프로그래머스

목록 보기
3/80

프로그래머스 문제 - 배열 뒤집기

class Solution {
    public int[] solution(int[] num_list) {
        int[] answer = new int[num_list.length];
        int j=0;

        for(int i=(num_list.length)-1; i>=0; i--){
            answer[j] = num_list[i];
            j++;
        }
        return answer;
    }
}
profile
비슷한 어려움을 겪는 누군가에게 도움이 되길

0개의 댓글