2022. 10. 31. 16:38 자기개발/코딩테스트
C++ (코딩테스트) - H-Index(프로그래머스)
문제
https://school.programmers.co.kr/learn/courses/30/lessons/42747
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
나의 풀이
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> citations) {
sort(citations.rbegin(), citations.rend());
for (int i = citations.size(); i >0; i--)
if (citations[i - 1] >= i) return i;
return 0;
}'자기개발 > 코딩테스트' 카테고리의 다른 글
| C++ (코딩테스트) - 메뉴 리뉴얼(프로그래머스) (0) | 2022.11.01 |
|---|---|
| C++ (코딩테스트) - 프린터(프로그래머스) (1) | 2022.10.31 |
| C++ (코딩테스트) - 튜플(프로그래머스) (1) | 2022.09.30 |
| C++ (코딩테스트) - [1차]캐시(프로그래머스) (1) | 2022.09.30 |
| C++ (코딩테스트) - 모음사전(프로그래머스) (0) | 2022.09.30 |