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
'코딩테스트 > Python' 카테고리의 다른 글
프로그래머스 스쿨 - 몫 구하기(Python) (0) | 2023.08.07 |
---|---|
프로그래머스 스쿨 - 모음 제거(Python) (0) | 2023.08.06 |
프로그래머스 스쿨 - 두 수의 합(Python) (0) | 2023.08.04 |
프로그래머스 스쿨 - 두 수의 차(Python) (0) | 2023.08.03 |
프로그래머스 스쿨 - 나머지 구하기(Python) (0) | 2023.07.30 |