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;
    }
}

 

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

배열의 평균값  (2) 2024.01.26
피자 나눠 먹기(3)  (1) 2024.01.26
피자 나눠 먹기 (1)  (0) 2024.01.26
짝수는 싫어요  (0) 2024.01.25
최빈값 구하기  (0) 2024.01.25

+ Recent posts