H index | Leetcode #274

H index | Leetcode #274

Techdose

3 года назад

40,024 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@arpitsatnalika
@arpitsatnalika - 22.12.2020 21:00

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;
}

Ответить
@arsalalam5998
@arsalalam5998 - 13.08.2020 20:44

unrelated question, which tool are u using for making these videos ?

Ответить
@ArbitCode
@ArbitCode - 12.08.2020 19:09

What is #274 at the last of video title.

Ответить
@kunalsoni7681
@kunalsoni7681 - 12.08.2020 06:39

Nice video 😊 too much
Thank you so much sir ❤️😇💕

Ответить