class Solution {
    public int solution(int slice, int n) {
        return n % slice == 0 ? n / slice : (n / slice) + 1;
    }
}

'공부 > 프로그래머스' 카테고리의 다른 글

옷가게 할인 받기  (0) 2024.01.26
배열의 평균값  (2) 2024.01.26
피자 나눠 먹기(2)  (0) 2024.01.26
피자 나눠 먹기 (1)  (0) 2024.01.26
짝수는 싫어요  (0) 2024.01.25

+ Recent posts