KWiOS
KWiOS0101
KWiOS
  • 분류 전체보기 (108)
    • Algorithm (41)
      • 이코테 (14)
      • 이코테 문제풀이 (21)
      • 프로그래머스 (6)
    • CS (1)
      • 모두를 위한 컴퓨터 과학(CS50 2019) (0)
    • iOS (15)
    • Swift (36)
      • Swift문법 (32)
      • 기타 (4)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 6

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
KWiOS

KWiOS0101

Algorithm/프로그래머스

Level2 - H - Index(Swift)

2022. 8. 9. 05:41
func solution(_ citations:[Int]) -> Int {
    
    let sortedCitaions = citations.sorted(by: >)
    var result = 0
    
    for i in 0..<sortedCitaions.count {
        if i < sortedCitaions[i] {
            result += 1
        }
    }
    return result
}

'Algorithm > 프로그래머스' 카테고리의 다른 글

Level2 - 타겟넘버(Swift)  (0) 2022.08.09
Level2 - 가장 큰 수(Swift)  (0) 2022.08.09
Level1 - 신규 아이디 추천(Swift)  (0) 2022.08.07
Level1 - 로또의 최고 순위와 최저 순위(Swift)  (0) 2022.07.31
Level1 - 신고 결과 받기(Swift)  (0) 2022.07.24
    'Algorithm/프로그래머스' 카테고리의 다른 글
    • Level2 - 타겟넘버(Swift)
    • Level2 - 가장 큰 수(Swift)
    • Level1 - 신규 아이디 추천(Swift)
    • Level1 - 로또의 최고 순위와 최저 순위(Swift)
    KWiOS
    KWiOS

    티스토리툴바