공부/프로그래머스

피자 나눠 먹기(2)

딸기버블티 2024. 1. 26. 14:54

 

 

class Solution {
    public int solution(int n) {
        int answer = 0;
        for(int i=1; i<=100; i++){
            if((6*i) %n == 0){
                answer = i;
                break;
            }
        }
        return answer;
    }
}