Grumpy Bookstore Owner - Leetcode 1052 - Python

  Рет қаралды 10,298

NeetCodeIO

NeetCodeIO

Күн бұрын

Пікірлер: 40
@NeetCodeIO
@NeetCodeIO 2 ай бұрын
sorry about missing the last couple problems. whenever i come back to an easyish question, i feel bad cause people are gonna think im dodging the hard ones end of the month is when it gets tough so lets gooooo 😤😤
@adilansari-hq9ge
@adilansari-hq9ge 2 ай бұрын
Hi Navdeep, Thank you for uploading. Please upload easyish questions as well , it is needed to boost confidence and build the foundation.
@akash-kumar737
@akash-kumar737 2 ай бұрын
No worries brother. There are others too who help us but your explanation is quite exceptional 😅.
@fancypants6062
@fancypants6062 2 ай бұрын
If you have the time and energy to go back to the bouquet of flowers question, I would really appreciate it. Your channel is great, thank you for what you are doing here :)
@shahzodshafizod
@shahzodshafizod 2 ай бұрын
Hi bro. Thanks for the best Leetcode content on KZbin. First of all you're the only Indian who speaks without accent, I'd like to here your Indian accent too. Secondly your absence for some period of days is a good experience for those who are dependent of your videos and don't even try to solve problems by themselves.
@sauravsingh4497
@sauravsingh4497 2 ай бұрын
Can you help us in the previous two binary search questions?
@TheWhiteFlame574
@TheWhiteFlame574 2 ай бұрын
we needed you yesterday and the day before
@GeetainSaar
@GeetainSaar 2 ай бұрын
😘
@GeetainSaar
@GeetainSaar 2 ай бұрын
Okay
@MykolaPavluchynskyi
@MykolaPavluchynskyi 2 ай бұрын
One optimization can be - to do the logic about recalculating max window inside if grumpy[r] - because we only need to recalculate if we find next grumpy == 1. So lines 12-16 - can be in if section. Instead of if we have to use while, but we will do less max comparisons for sure, because we will have amount of max comparisons equals to amount of grumpy days, instead of length of the array.
@laceycodetime
@laceycodetime 2 ай бұрын
This leetcode question would be a good plot for an anime
@bhuvan9956
@bhuvan9956 2 ай бұрын
"We are bigger than everybody else" lol
@DebopriyoBasu
@DebopriyoBasu 2 ай бұрын
You post videos at the time I solve daily leetcode problems :) If I get stuck, it's a lot of help. Thanks and keep posting!
@harshithd9539
@harshithd9539 2 ай бұрын
we needed you for yesterday and day before yesterday problem sir
@nonefvnfvnjnjnjevjenjvonej3384
@nonefvnfvnjnjnjevjenjvonej3384 2 ай бұрын
indians and chinese love leetcode. why is that?
@chien-yuyeh9386
@chien-yuyeh9386 2 ай бұрын
So nice to see ur video again!
@benedictaamoah5310
@benedictaamoah5310 2 ай бұрын
First! Thank you very much Sir for all your help.
@pat777b
@pat777b 2 ай бұрын
This is what I came up with. class Solution: def maxSatisfied(self, customers: List[int], grumpy: List[int], minutes: int) -> int: left = 0 right = minutes - 1 candidate = 0 for i in range(len(customers)): candidate += customers[i]*abs(grumpy[i] - 1) for i in range(left, right+1): candidate += customers[i]*grumpy[i] ans = candidate while right < len(customers) - 1: candidate += customers[right+1]*grumpy[right+1] candidate -= customers[left]*grumpy[left] if candidate > ans: ans = candidate left += 1 right += 1 return ans
@innovativesmartlearning9610
@innovativesmartlearning9610 2 ай бұрын
can you please upload videos of leetcode weekly and biweekly also
@pastori2672
@pastori2672 2 ай бұрын
honestly not even reading the description is reasonable they need to hire someone specifically for these problem descriptions
@Moirai0_0
@Moirai0_0 2 ай бұрын
Thanks for the video.
@anshumansinha5874
@anshumansinha5874 2 ай бұрын
Q) 1156. Swap For Longest Repeated Character Substring . Can this be related to your earlier solution of 424. Longest Repeating Character Replacement ?
@xhero9642
@xhero9642 2 ай бұрын
Can you share the solution for 1552. Magnetic Force Between Two Balls
@mohaimenchowdhury
@mohaimenchowdhury 2 ай бұрын
I solved it using Prefix sum + 0/1 Knapsack, but runtime was poor 😐
@prajyot2021
@prajyot2021 2 ай бұрын
what if value 5 from ex 1 was at index 1, then a/c to solution left will removed leaving us with not max customers. Can Someone confirm or correct?
@timonshannikov6452
@timonshannikov6452 2 ай бұрын
Thanks a lot as always)
@dilmurodabdusamadov5572
@dilmurodabdusamadov5572 2 ай бұрын
i did prefix sum, worked somehow
@mohammedsuhail.s192
@mohammedsuhail.s192 2 ай бұрын
bro literally missing you few days .... put videos daily
@faelzinhh156
@faelzinhh156 2 ай бұрын
Nice
@mohanedomer9081
@mohanedomer9081 2 ай бұрын
where were you yester day brother , I needed you 😐😐
@zorxey3189
@zorxey3189 2 ай бұрын
grumpy
@tanjilurrahmanjim6507
@tanjilurrahmanjim6507 2 ай бұрын
if grumpy[r] == 1:
@the-wonderful-day
@the-wonderful-day 2 ай бұрын
1st!
@anonymouslurker313
@anonymouslurker313 2 ай бұрын
early
@RajdeepJadeja
@RajdeepJadeja 2 ай бұрын
Neetcode went on vacation when I needed him the most🥲
Count Number of Nice Subarrays - Leetcode 1248 - Python
10:18
NeetCodeIO
Рет қаралды 13 М.
1ОШБ Да Вінчі навчання
00:14
AIRSOFT BALAN
Рет қаралды 6 МЛН
ДОКАЗАЛ ЧТО НЕ КАБЛУК #shorts
00:30
Паша Осадчий
Рет қаралды 933 М.
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 43 МЛН
The Most Legendary Programmers Of All Time
11:49
Aaron Jack
Рет қаралды 557 М.
Sum of Square Numbers - Leetcode 633 - Python
14:26
NeetCodeIO
Рет қаралды 12 М.
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 633 М.
Why I focus on patterns instead of technologies
7:55
NeetCodeIO
Рет қаралды 223 М.
Delete Leaves With a Given Value - Leetcode 1325 - Python
14:45
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 132 М.
How India Is Failing Its Educated Youth
8:22
Bloomberg Originals
Рет қаралды 308 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 361 М.