Coding Test/Java

[프로그래머스 / Java] Lv.0 아이스 아메리카노

annovation 2025. 4. 26. 20:29

Question

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

 

프로그래머스

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

programmers.co.kr


Code

💡내 풀이

class Solution {
    public int[] solution(int money) {
        int[] answer = new int[2];
        
        answer[0] = money / 5500;
        answer[1] = money % 5500;
        
        return answer;
    }
}

 

💡참고하면 좋은 풀이

class Solution {
    public int[] solution(int money) {
        return new int[] { money / 5500, money % 5500 };
    }
}
반응형