본문 바로가기
코딩테스트/Python

프로그래머스 스쿨 - 머쓱이보다 키큰 사람(Python)

by 보안매크로 2023. 8. 5.
728x90
def solution(array, height):
    answer = 0
    array.sort()
    for i in array:
        if i > height:
            answer += 1
    return answer


#다른 사람 풀이

# def solution(array, height):
#     array.append(height)
#     array.sort(reverse=True)
#     return array.index(height)

# def solution(array, height):
#     return sum(1 for a in array if a > height)
728x90