입출력 예 풀이 import Foundation func solution(_ k:Int, _ m:Int, _ score:[Int]) -> Int { let sortedScore: [Int] = score.sorted().reversed() var result = 0 for index in 1 ... sortedScore.count { if (index + 1) % m == 0 { result += sortedScore[index] * m } } return result } import Foundation func solution(_ k:Int, _ m:Int, _ score:[Int]) -> Int { let sortedScore: [Int] = score.sorted().reversed() va.....
원문 링크 : [Swift / 프로그래머스 Lv.1] 과일 장수