Комментарии:
O(n) C++ solution:
int hIndex(vector<int>& citations) {
int n=citations.size();
vector<int> arr(n+1);
for(int i=0;i<n;i++)
{
if(citations[i]>n)
arr[n]++;
else
arr[citations[i]]++;
}
int sum=0;
for(int i=n;i>=0;i--)
{
sum=sum+arr[i];
if(sum>=i)
return i;
}
return 0;
}
unrelated question, which tool are u using for making these videos ?
ОтветитьWhat is #274 at the last of video title.
ОтветитьNice video 😊 too much
Thank you so much sir ❤️😇💕