L1 : 과일 장수 Python

jhyunn·2023년 1월 23일
0

Programmers

목록 보기
57/69

L1 : 과일 장수 Python

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

def solution(k, m, score):
    answer = 0
    score.sort(reverse=True)
    i = 1
    while len(score) >= i*m:
        answer += score[m*i-1] * m
        i += 1
    
    return answer

indexing을 하지 않아야 시간을 준수할 수 있다.

profile
https://github.com/Sungjeonghyun

0개의 댓글