관리 메뉴

me made it !

[알고리즘] JAVA | 프로그래머스 | 배열 뒤집기 본문

TIL/알고리즘

[알고리즘] JAVA | 프로그래머스 | 배열 뒤집기

yeoney 2023. 3. 21. 17:45
반응형
class Solution {
    public int[] solution(int[] num_list) {
        int[] answer = new int[num_list.length];
        for (int i = 0; i<num_list.length; i++){
            answer[i]= num_list[num_list.length-i-1];
        }
        return answer;
    }
}
반응형