You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func solution(_ k:Int, _ m:Int, _ score:[Int])->Int{// 1. score 내림차순 정렬varscore= score.sorted(by:>)varsum=0// 2. stride로 배열 순회 (m 개수만큼)// 3. 해당 값 * m 을 sum에 더하기
if score.count != m {
for i in stride(from: m -1, to: score.count, by: m){
sum +=score[i]* m
}}else{
sum +=score[score.count -1]* m
}return sum
}
The text was updated successfully, but these errors were encountered:
💬 문제
[코딩테스트 연습 - 과일 장수](https://school.programmers.co.kr/learn/courses/30/lessons/135808)
💬 Idea
💬 풀이
The text was updated successfully, but these errors were encountered: