본문 바로가기
  • Let's study
PS/Programmers

[프로그래머스 Lv.0] 배열 뒤집기(Java)

by 코딩고수이고파 2026. 7. 11.

문제

https://school.programmers.co.kr/learn/courses/30/lessons/120821

 

프로그래머스

SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

 

코드

class Solution {
    public int[] solution(int[] num_list) {
        int len=num_list.length;
            
        int[] answer = new int[len];
        
        for(int i=0; i<len; i++){
            answer[i]=num_list[len-1-i];
        }
        
        return answer;
    }
}

댓글