반응형 H-Index1 [프로그래머스 - 정렬] H-Index 📄 [정렬] H-Index Swift Source Code import Foundation // MARK: - https://en.wikipedia.org/wiki/H-index func solution(_ citations:[Int]) -> Int { let length = citations.count // MARK: - First we order the values of f from the largest to the lowest value. (DESC - 오름차순) let paper = citations.sorted { $0 > $1 } // MARK: - we look for the last position in which f is greater than or equal to the position.. 2019. 4. 5. 이전 1 다음 반응형