
using System;
using System.Linq;
public class Solution
{
public int solution(int[] citations)
{
// 인용 횟수
int hIndex = 0;
// 내림차 순 정렬
Array.Sort(citations,(x,y) => y.CompareTo(x));
for(int i = 0; i < citations.Length; i++)
{
// 높은 숫자부터 검사하므로
// ex) 6 >= 0 + 1 = true, 5 >= 1+1 = true, 3 >= 2+1 = true
// 1 >= 3 +1 = false;
if(citations[i] >= i + 1)
hIndex++;
else
break;
}
return hIndex;
}
}
Unity C#만 사용하다 일반 C#을 통해 구현하려니 익숙치 않습니다..