Maybe i should change my shirt color based on the difficulty of the problem. Thoughts?
@bzrkr44417 күн бұрын
Start wearing different coloured flannels like Anthony Fantano
@Tejesh-t1t17 күн бұрын
genuis
@adityamanitripathi47817 күн бұрын
So cool
@yassinmohamed724017 күн бұрын
Cool
@leeroymlg469217 күн бұрын
hard problems = shirtless
@ankitpratap249617 күн бұрын
For C++, you need to ensure floating point division: double real = static_cast(quantities[i]) / a; int val = std::ceil(real); stores += val;
@finemechanic16 күн бұрын
Or you can avoid floating point arithmetic altogether. stores += quantities[i] / a + (quantities[i] % a ? 1 : 0); You may google for even more sophisticated, but less explicit solutions.
@RakimMiddya16 күн бұрын
you can just stores += (quantities[i]+a-1)/a; learnt it from larry's vid
@Farkhod-i7n17 күн бұрын
bro be scheming up in O(1) in that thumbnail
@unlucky-77717 күн бұрын
9:52 I think our left can be = ceil(sum(quentities)/n) because we know that we must to deliver item to every store and instead of starting 1 (may or may not deliver the items) we can start at the lowest possible left that we know we will deliver items to each store but we don't know if it is the optimal one
@jody421017 күн бұрын
I didnt major in CS so I only took some introduction courses on programming and wasn't familiar with algorithms. But learning how to do leetcode with your videos have been so helpful. Like you suggested I went to watch the koko video you made and managed to solve this problem without having to get into the coding explanation part! I can't really say I solved it all on my own bc the koko video helped a lot due to how similar these two problems are, but I really feel that I am learning and improving. Thank you so much
@anonanon659617 күн бұрын
You could stop at five or six stores or, just one.
@satyajit_200316 күн бұрын
@NeetCodeIO, I think instead of initializing another variable 'res' we can return r+1, I tried and it works
@greedyfishbones17 күн бұрын
u look so happy!! its so cute
@IK-xk7ex17 күн бұрын
I solved it because yesterday's problem was binary search :)
@MP-ny3ep17 күн бұрын
Beautifully explained. Thank you
@chetanshrivastava376217 күн бұрын
God bless you brother.Nice explanation.
@nicolasrodriguez62316 күн бұрын
Did well on my Google interview but didn’t pass. Back to the grind I guess.
@pastori267216 күн бұрын
bro actually did it again 😂
@programming_with_shashank17 күн бұрын
Hey, in the helper function why not just divide the n value by the summation of the quantities array? Why do we have to go one by one for each quantity?
@Reck102517 күн бұрын
Each store can only receive one type of product. You might get false positives if you just sum up the quantities
@programming_with_shashank17 күн бұрын
@@Reck1025 Tried and testing for myself, makes sense now 🥲
@mohamedsayed869717 күн бұрын
I do not mean anything about you, but I am starting to miss the old thumbnail, it was like a NeetCode trademark kind of thing, at least for me. It nice seeing you on these thumbnails tho.
@JamesBond-mq7pd17 күн бұрын
can someone explain why whenever we find a valid x, it’s smaller than any previously found x???
@JamesBond-mq7pd17 күн бұрын
i think i got it. In binary search, we always move towards a certain point, and when we set left = mid + 1, it will never be equal to or greater than the previous right = mid - 1.
@dekumidoriya-qi2is16 күн бұрын
@@JamesBond-mq7pd yeah that's pretty much the reason :)
@web-unlocked17 күн бұрын
I had no clue how to solve this problem😇 then I watch 30 seconds of the video and re did koko eating bananas 🥵then I was able to solve this problem in under 5 min🤣
@LNGAMING13517 күн бұрын
C++😢
@kanhaiwadekar661517 күн бұрын
tf unc in the thumbnail for ☠
@whiteasian277716 күн бұрын
bro thinks he is an indian dsa teacher in the thbumnail
@jalalhamzah493817 күн бұрын
First😅
@deathxunnat469317 күн бұрын
first
@xiaoshen19417 күн бұрын
Bro u solved the ques and made a video and uploaded it within 25 min of the daily ques!! 🫡