BS-17. Aggressive Cows | Binary Search Hard

preview_player
Показать описание

Notes/C++/Java/Python codes: Soon

We have solved the problem, and we have gone from brute force and ended with the most optimal solution. Every approach's code has been written in the video itself. Also, we have covered the algorithm with intuition.

You can follow me across social media, all my handles are below:

0:00 Introduction of Course
Комментарии
Автор

you are "The" best teacher In terms of explanation
I have tried many YouTubers like Codehelp, kunal kushwaha but your way of explaining things is much better as you focus on approach not only on coding the things without visualizing possibilities
may god bless you for helping many Tier 3 students like me for providing this premium content just for free!

technicalteam
Автор

I solved this question just after you explained the question, and this is because you explained previous questions so well, and this is the power of your teaching

himanshurane
Автор

This man is magic when comes to a certain set of problems!!!.... Simply, impressed by him! The explanation easily depicts how much hardwork he has put in! HandsOff to you sir!❤

yes
Автор

Is it only me or any one else have also felt that the binary search medium problems are a bit doable rather than the easy problems... They seem to be hard. However, doesn't this problem seems to be a. 90% similar to minimum days to ship d packages or m bouquet flowers problem.

manitoshpaul
Автор

13:24 like he says that range can be optimized. The more optimal lower bound for search space will be the Minimum(adjacent difference). Reason: Let's take array [100, 200, 240, 400, 800]. In this 40 would be the lower bound and not starting from 1. Because if you want to place minimum 2 cows (like question says). You cannot attain difference any lower than this in sorted array which is 40 in this case i.e. Minimum(adjacent difference)

rohitverma
Автор

You win our hearts in every video, specially the hard problems by explaining them in such a beautiful and simple manner.
Thank you for your enormous contributions toward the Coding Community❤

harshpanwar
Автор

After reading the problem statement, I didn't even understand it. It is crystal clear after watching your explanation! Thanks Striver :)

lavanyam
Автор

I solved this question without watching the video just because of the fact that I knew that binary search on answers is going to be applied here, but my question is that how the hell can someone come up with the binary search approach if he/she doesn't know that it is going to be solved using binary search. When I first read this question, the first thought that came to my mind was applying dp.

rickk
Автор

coded optimal in one go, without seeing video 😀 . THANKS A LOT STRIVER FOR EVERYTHING

devgarg
Автор

I have been asked a similar question when i appeared for Google, the question was :
The city is affected with Covid 19 and hospitals are filling up with patients.
As a doctor, you need to make sure the patients are treated well. To do so You have some patients and beds for them to be allocated and the survival rate of the patients will be higher only if they are placed as far as possible.
Given m beds and n patients maximize the minimum distance between any two patients to increase the survival rate.
Ans : Same Binary Search approach .

visase
Автор

Clearly Understood Striver. Thanks for this awesome series.

elizabethr
Автор

In the context of this problem, you could also start with low = 1 since it doesn't make sense to have two rooms at the exact same position. The only reason to start with 0 is to provide a clear lower bound for the binary search. The result wouldn't be affected either way since the binary search would quickly discard unfeasible distances, but starting from 1 would be more intuitive in this context.

aniketwdubey
Автор

Habibi issme thoda mushkil hua samjne me but dimak lagai toh samaj aagai ....tusssi ek number kaam karta hai ...acchi bideo banaata hai

CodeMode
Автор

Understand everything
Min Of Max pattern super duper clear

ujjawalraj
Автор

Is binary search that easy, or is it the sriver effect? 😊

sauravchandra
Автор

I searched for aggressive cow solution and i got you THE BEST EXPLANATION

AkshayGoel-ofic
Автор

Genereally i never do any comment to video but the guys was insane.. this made DSA too easy for mr (I feel slowly slowly DSA is cup of my v tea)

nevil
Автор

Man, you're built different. You make everything understandable! Keep doing the same <3

revanthchouhan
Автор

The best explanation for Aggressive Cows problem!

aaryanjavalekar
Автор

In the Brute Force approach return i-1 won't work in all cases, we could use a variable to keep track of the distance and then return it

darrienxavier
welcome to shbcf.ru