[java] 프로그래머스 - 중복된 숫자 개수

세상을 바꾸는 개발자·2023년 3월 11일
0

[문제링크 - 프로그래머스 - 중복된 숫자 개수] https://school.programmers.co.kr/learn/courses/30/lessons/120583

class Solution {
    public int solution(int[] array, int n) {
        int answer = 0;
        for(int a : array){
            if(a == n)
                answer++;
        }
        return answer;
    }
}
profile
초심 잃지 않기

0개의 댓글