프로그래머스/Lv.0

[Swift] 등수 매기기

물복딱복준복 2022. 12. 14. 22:32
import Foundation

func solution(_ score:[[Int]]) -> [Int] {
    score.map { $0.reduce(0,+) }.map {
        score.map {
            $0.reduce(0, +)
        }.sorted(by: >).firstIndex(of: $0)! + 1 }
}