[프로그래머스]피자 나눠먹기 2

박예림·2023년 3월 27일
0

코테

목록 보기
56/132

class Solution {
    public int solution(int n) {
        int answer = 0;

        for(int i=1; i<=n; i++) {
            if ((6*i)%n ==0) {
                answer = i;
                break;
            }
        }
        return answer;
    }
}
profile
응애 나 아기개발자

0개의 댓글