본문 바로가기

코딩테스트

[프로그래머스] 머쓱이보다 키 큰 사람

https://school.programmers.co.kr/learn/courses/30/lessons/120585

 

프로그래머스

SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

 

class Solution {
    fun solution(array: IntArray, height: Int): Int {
        var answer: Int = 0
        for(item in array) {
            if(height < item) {
                answer++
            }
        }
        return answer
    }
}

 

 

'코딩테스트' 카테고리의 다른 글

[프로그래머스] 이어 붙인 수  (0) 2025.02.15
[프로그래머스] 잘라서 배열로 저장하기  (0) 2025.02.09
[프로그래머스] n의 배수  (0) 2025.01.12
K번째수  (0) 2025.01.10
코딩테스트 추억점수  (0) 2024.10.05