프로그래머스 - 피자 나눠 먹기 (2)

차관호·2023년 3월 11일
0

문제링크 - 프로그래머스 - 피자 나눠 먹기 (2)

class Solution {
    public int solution(int n) {
        int piz = 6;
        int count = 0;

        while(true) {
            count++;
            if ((6 * count) % n == 0) {
                break;
            }
        }
        return count;
    }
}
profile
안녕하세요 :-)

0개의 댓글