Leetcode Hard || 2790. Maximum Number of Groups With Increasing Length || Weekly Contest 355

preview_player
Показать описание
TC = o(nlogn) + o(n)
SC = o(1)
Рекомендации по теме
Комментарии
Автор

CODE:
int usageLimits) {
sort(usageLimits.begin(), usageLimits.end());
long long extra = 0;
long long ans = 0;
long long sz = 1;
for(int i =0;i<usageLimits.size();i++)
{
int qt = usageLimits[i];
if(qt+extra>=sz)
{
ans++;
extra = qt+extra-sz;
sz++;
}else{
extra+=qt;
}
}
return ans;
}

corrosive
Автор

hi big fen of this gaympley achhi video h

hitenmahawar
Автор

bhaiji btayenge c++ with dsa krne mei kitta time lgega?

Bruiser
Автор

Sir ek doubt hai ...apse puchke clear krna hai 🤔

kunalthakur
Автор

GOB k liye bhe koi bharya code bna do bhai ☻🤗

Gobchemist