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

박예림·2023년 3월 2일
0

코테

목록 보기
30/132

class Solution {
    public int solution(int[] array, int n) {
        int answer = 0;
        for (int i =0; i <array.length; i++){
            if (array[i] == n){
                answer++;
            } else {answer = answer;}
        }
        return answer;
    }
}
profile
응애 나 아기개발자

0개의 댓글