Please watch our new video on the same topic: kzbin.info/www/bejne/iJCwl6pqmtxgjNE
@artofwrick10 ай бұрын
Problem in leetcode : Magnetic force between 2 balls. Leetcode...
@rogerop67213 жыл бұрын
similar question on leetcode -> 1552. Magnetic Force Between Two Balls 1870. Minimum Speed to Arrive on Time 875. Koko Eating Bananas 1011. Capacity To Ship Packages Within D Days 1283. Find the Smallest Divisor Given a Threshold 1482. Minimum Number of Days to Make m Bouquets 2064. Minimized Maximum of Products Distributed to Any Store
@zyro99223 жыл бұрын
Thank you man. Really appreciate it
@rogerop67213 жыл бұрын
@@zyro9922 welcome
@kage-musha17023 жыл бұрын
1231 Divide Chocolate 774 Minimize Max Distance to Gas Station 410 Split Array Largest Sum these too :D
@vasujain19703 жыл бұрын
nice, thanks!
@rithikdutt13323 жыл бұрын
Thankss!
@anujjain92733 жыл бұрын
for all those who are confuse , at 3:21 the c2 should be drawn under the stall 8 column not under stall 4 , although explanation was good
@takeUforward3 жыл бұрын
Checkout out playlist for all DSA in the description. Follow me at Instagram for updates: Striver_79
@prithvijitbasak3 жыл бұрын
Thank you sir for this video. This question was not clear for me after watching a video on this question on KZbin. But your explanation is extraordinary ❤️🔥. It's crystal clear for me now. Keep making more these top notch quality content. ❤️❤️🔥.
@worldaffairs2.0603 жыл бұрын
Hindi mein bbhi pdahye sir
@SudhanshuKumar-lp1nr3 жыл бұрын
high=arr[n-1]-arr[0]
@georgebell19272 жыл бұрын
Striver is the dsa playlist the solns for the sde sheet that u prepared.For example does the linked list playlist consists of the solutions to the linked list problems in the sde sheet.Please answer because if they are the solns i ll watch them after trying the sde sheet.
@jashanbansal26133 жыл бұрын
Aggressive Striver :)
@rishabh_pant Жыл бұрын
😂
@debanjanghosal618Ай бұрын
couldn't understand from his new videos but this old gem did the magic for me❤
@soumyadipbhowmik22202 жыл бұрын
Your explanaining capabilities are absolutely beautiful. People really be coding it out without thinking the approach which you did beautifully.
@nikhilrana26803 жыл бұрын
Aggressive cows , explained in a calm manner, striver bhaiya op🔥
@vinaygupta23692 жыл бұрын
He was also agressive in making solution understood :)
@mohitbajaj44652 жыл бұрын
we can also take low as the minimum gap between the consecutive element alfter sorting. For example if the array is 10 50 100 200. then we can take low as 40. because that can be the minimum ans if the number of cows is 4. This will reduce the time complexity for binary search. Please correct me if i am wrong.
@lakshsinghania Жыл бұрын
yeah, ig coz in book allocation problem the search space was from max_element ---- sum of all elements altho here we are not finding the sum as the problem statement is diff we need the min distance that is low till the end
@sumitanand62492 жыл бұрын
More Good Binary Search Problems (Leetcode). Good luck and have fun! 1539. Kth Missing Positive Number 1482. Minimum Number of Days to Make m Bouquets 1283. Find the Smallest Divisor Given a Threshold 1231. Divide Chocolate 1011. Capacity To Ship Packages In N Days 875. Koko Eating Bananas 774. Minimize Max Distance to Gas Station 410. Split Array Largest Sum
@princebharti13962 жыл бұрын
thanks a lot for sharing
@sahilgupta56482 ай бұрын
best video for aggressive cows i have Evered watch thanks striver for this amazing content
@rudraprasaddash38093 жыл бұрын
Thank you bhaiya for this amazing explanation. But, the "NOOO! WHY?" at 10:40 is epic🤣
@aniketbhusal34893 жыл бұрын
Your explanation and the topic clearance has grown exponentially with whiteboard, you are gonna progress a lot for sure , no looking back.
@rounakmukherjee95402 жыл бұрын
Thanks for those 2 Gems... those are really something that I am searching for . Both in book allocation and Aggressive cows question's, you give a quality explanation that Isolved some similar question like that by my own. Thank you.
@xZero_.8 ай бұрын
Incredible Explanation, Thanks for the Tutorial!
@vikashgupta33053 жыл бұрын
Haye your excitement in 10:52, excites me I get more Interested in Q after seeing your interest and energy, which matters me the most for my love of coding. You're true gems in our community I seriously admire your nature and thought process.❤️
@ayushagarwal20913 жыл бұрын
Your hard work and dedication can be clearly seen from ur eyes🙏🙏🙏
@sandeepnallala483 жыл бұрын
Bro i knew this prblm and still came here see the way u explain, and just after starting hit the like 💯💯💯. Great wrk bro
@devvratsaxena89623 жыл бұрын
This is honestly one of the best explanation for all the questions I came across ever on youtube. Thanks sir for such awesome content.
@jaiminsolanki54783 жыл бұрын
Bro the way u teach, the energy, makes learning so fun and interesting....tysm Brother!
@samreenimam860810 ай бұрын
we're finding " do ke bich ki duri jitna ho sake badha do., but within given stalls".
@varshinielangovansumathi65633 жыл бұрын
Hi! Please upload a video on Time and Space Complexity if possible . I just finished watching your C++ STL video today. You're doing a great job👏. I really like the way you explain things🥺🔥 Thanks a ton 🙏❤️
@giridharjadala21822 жыл бұрын
It was pretty tough to figure out the search space right after going through the question, but your intuition was really good.
@gowthamvb418 Жыл бұрын
Everything in this video is clear and excellent. However I couldn't figure out the below. Can Anyone explains me to clear it out. Why we need to place our first cow in first stall. Placing the first cow in different(next) stalls leads to different answer right? Also why are we assuming min distance of cow as firstly placed two cows, i.e., stall[0] and next upcoming stall[i] that covers min distance, probably min distance will be on next upcoming stalls as well right? Hoping to get clear my doubts. Thanks.
@naro.tam_3 жыл бұрын
Thanx Striver Bhaiya.came here from your Binary Search master class and I easily solved all the below listed questions .Thanx for these amazing concepts
@abhishekkumarsingh86033 жыл бұрын
Ek dum mast sequential way mein aa rha hai video pura thought process bana diye hai pura relate kar paye pichle video se pehle toh q dekh ke pata hi nhi chalta tha ki binary search ka q hai 😊
@ratnadeepbhattacharya32373 жыл бұрын
Bhaiya classes k din yaad a gye..... Loved it...... Nd all thanks to u for making such a tough prblm bread and butter.....
@lasanihussain88102 жыл бұрын
Here after binary search master class, was able to do aggressive cows on my own.
@Dead_Zone_09222 жыл бұрын
i invest my time to understand 7 hours i have made many times dry and run i try to solve it using sliding window and brute fornce and binary search but i couldn't now i understood complitely thank u bro thank u so mcuh ........
@Bhatkal_Vlogger2 жыл бұрын
how can you place three cows 10:52 mast bhaiya
@wian72843 жыл бұрын
"Definitely not!"😅😂 Reminds me of Dhoni saying this :p
@gauravgupta55302 жыл бұрын
18:58 How to place cows;
@aditya_jaiswal. Жыл бұрын
After lot of struggle through many videos finally here I understood this concept 🥰. Kisko credit diya jaye meri mehanat ko ya striver bhaiya❤ ko. yrr sach me book allocation problem ke bad 2 dino se samjhne ki koshish kar rha tha🤒😅
@lawbindpandey4023 жыл бұрын
The lesson learnt here is that : "Binary Search can also be used to find max value of a monotonic function" .....
@kaustav073 жыл бұрын
Kindly include painters partition too please.
@takeUforward3 жыл бұрын
Its same as allocation of minimum pages, exactly same problem..
@ashwinshetgaonkar63293 жыл бұрын
intuition behind each step nicely explained.
@heyrmi3 жыл бұрын
there is a drastic improvement from video-1 of whiteboard. you are improving by each video.
@aadityabedi31403 жыл бұрын
Bhaiya thanks for this video and Tree series kab tab ayegi please bta do placements aane vali hai hamari
@cenacr0072 жыл бұрын
why is lowest possible distance 1 ? lowest possible should be when 2 cows are placed sided by side in the first 2 stalls with minimum values, but no body said the distance between first 2 stalls will be guaranteed 1, what if the array is 1 3 5 7 9, will we ever have a min distance 1 b/w 2 cows in such a case ? I think it should be arr[1] - arr[0] after sorting the array. Can somebody explain ?
@codetogether24x72 жыл бұрын
same doubt bhai
@lakshsinghania Жыл бұрын
yeah the search space will be more specifically low will be after sorting arr[1] - arr[0]
@rohitbagade91822 жыл бұрын
what if instead of 9 there is 12. now if we try for ans 4 c1 = 1 c2 = 8 c3 = 12 c1-c2 = 7 c2-c3 = 4 we can get ans for 4 , by evaluating c2-c3. if we only check c1-c2, then i guess we'll miss this testcase. (instead of 9, 12)
@stith_pragya Жыл бұрын
Thank You So Much Striver Brother............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@amanali95012 жыл бұрын
at 14:02 why c1 and c2 is kept at 1 and 4 , it should be at 2 and 4
@SidNegi25113 жыл бұрын
3:20 konse nashe h? How the hell difference of 2 and 4 is 6😢 and difference of 4 and 9 is 1
@takeUforward3 жыл бұрын
Slider corrected it..
@SidNegi25113 жыл бұрын
@@takeUforward btw you explain things very well.. abhi tak 2 videos dekhi h lekin concepts bahut badhiya or clarity ke saath smjh aajate h..
@swapnanilgupta3046 Жыл бұрын
Great explanation. I understand that we have to be greedy and place the first cow always at the first position, but if after doing that we do not arrive at the solution, can no other solution exist if place the first cow at 2nd/3rd position and then try to place rest of the cows?
@nayanjha56702 жыл бұрын
bhaiya is question me array jo milega wo sorted format me milega?
@PranavPrajapati-hd2eu Жыл бұрын
Gone through all other video on this question. But this one is amazing
@subhajeetchakraborty17912 жыл бұрын
Your excellent art of explaining these questions has inspired me to not lose hope and improve my problem solving skills further
@ayushjain97232 жыл бұрын
One of the best explanation thanks Striver ! ❤❤
@meghnagupta39072 жыл бұрын
Vry nice explanation got every bit and learn something new. tysm
@baz2839 Жыл бұрын
to place cow at 1st position we need to sort array otherwise we wont get correct answer
@rajat75843 жыл бұрын
Poori B.Tech nikal gayi par ye question ek baar me kabhi solve nahi hua 😂. Ab MS karte hue dekh raha hun. Thanks bro😀
@wisdomkhan2 жыл бұрын
Thanks to your previous videos, and intelligent ordering of questions in the SDE sheet, I did this on my own. Thanks bhai :)
@makaty9883 Жыл бұрын
thank you striver, i really appreciate that man!!
@shivayvinaik77942 жыл бұрын
amazing explanation mann!!!!!!!!!!!!!!!!! thank you so mucchhhh
@Finimals2 жыл бұрын
This is a very good explanation
@cinime2 жыл бұрын
Understood! Super awesome explanation as always, thank you very much!!
@englishlnowledge4862 жыл бұрын
For this question array must be sorted?
@rishabhgupta947 Жыл бұрын
Can someone explain why we are always assuming cow1 to be at index 0. At 19:30 mins in video co-ord = a[0] ? Can there not be any case when 1st cow is placed at any other index other than zero ?
@trysha2340 Жыл бұрын
We need the best solution, thus the best solution is to place first cow in the first stall, and then from onwards we will get the best solution automatically.
@meetjoshi4521 Жыл бұрын
great explanation sir
@surajjadli17473 жыл бұрын
Like the thumbnail simple 👌 just need to show front face.😄🏋🔥🔥🔥
@vamsipriya62042 жыл бұрын
Came here because of the binary search master class!
@radhikachaudhary23662 жыл бұрын
I have one doubt, you said if it's an unsorted array then sort it . Then after sorting ,the distance between the coordinates will change and perhaps answer will also change
@anshsrivastava87542 жыл бұрын
Nobody gives a damn about your Doubts!
@saurabhahuja67073 жыл бұрын
Possible combinations are 5c3 i.e 10
@GdLongerHandle3 жыл бұрын
The energy 👀⚡⚡
@kunal_chand3 жыл бұрын
Is this question a part of the SDE sheet, because I can't find it in any section. Anyway, Kudos to your efforts!
@takeUforward3 жыл бұрын
Binary search, please use the google doc version, and don't download it!! As I keep updating it..
@abhishekkumarsingh86033 жыл бұрын
@@takeUforward kuch ladke humare pehchan ke hardcopy nikaal ke highlighter chalate hai sde sheet pe unka kya kiya jaye😂
@manavshah74503 жыл бұрын
@@abhishekkumarsingh8603 hahaahahahaahahah
@aravakrishnaveni18013 жыл бұрын
Your explanation is amazing sir
@scooby-doo76283 жыл бұрын
Hi, I know you are busy, recently i have gone through you segment tree with lazy propagation lecture, the concept u provide is amazing. Can you please make a video on persistent segment tree when you are free?
@vinod1922-n3v Жыл бұрын
Thank you bhaiya. Great explanation
@soumikdutta78673 жыл бұрын
Bhaiya kaya explain kiya ho !!! Lit !! Love this explanation :-)
@RahulSingh-db3ge3 жыл бұрын
Tum bhut mst kaam krta hai striver bhai 🙂🙂.
@mohammadumaidansari50873 жыл бұрын
Another best one from the best 👍💯
@nileshsinha78693 жыл бұрын
Understood ❤❤ Great Explanation ..keep this coming
@dudamneerajdattu1459 Жыл бұрын
today's codestudio's moderate difficulty problem, and i understood the approach but somewhere I am struggling to code
@hassanmohammed9042 жыл бұрын
Why does the first cow have to be at the left extreme?
@rishabhgupta9846 Жыл бұрын
After getting initial intuition able to solve by myself,thanks striver
@sakshamsrivastava62803 жыл бұрын
great explaination.Thankyou for providing this
@yashipathak61842 жыл бұрын
THANK YOU!!
@chaitanyakumar92293 жыл бұрын
similar to arrange books -> which are all based on painters partition alogo 😁👍
@srushtinarnaware4919 Жыл бұрын
thankyou
@siddharthupadhyay42462 жыл бұрын
Thank you sir, great explanation
@shantanumapari66792 жыл бұрын
very lucidly explained!!
@chayanjain69023 жыл бұрын
Sir when will stack and queue solutions will come?
@MJ-dq8om3 жыл бұрын
Nice explanation
@sankalpjain48413 жыл бұрын
Please, can anyone explain, why to take low=1, instead of low=xi[1]-xi[0] in binary search approach. ThankYou in advance
@naveensingh26582 жыл бұрын
1 will be the lowest possible minimum distance.
@cenacr0072 жыл бұрын
@@naveensingh2658 why, lowest possible should be when 2 cows are placed sided by side in the first 2 stalls with minimum values, but no body said the distance between first 2 stalls will be guaranteed 1, what if the array is 1 3 5 7 9, will we ever have a min distance b/w 2 cows in such a case ? I think it should be arr[1] - arr[0] after sorting the array.
@arnavagrawal34992 жыл бұрын
@@cenacr007 No actually there could be a case for ex. - 3 6 9 10 11 13 where we need to place 6 cows then min possible would be 1 in that case so in my opinion it should be actually min(arr[i + 1], arr[i]) for i = 0 till size - 2 index (in this case till 4th index) but it doesn't matter even if we take 1 as the minimum because the final answer will only give the maximum possible minimum distance.
@amanbhadani88402 жыл бұрын
More accurately i say low is the minimum value among all the consecutive differences of elements.
@012akashh3 жыл бұрын
You are superb buddy ..so hard working where do you get this inspiration from ? Just finished looking the last video and new one is ready 😊
@arint7252 жыл бұрын
similar to book allocation problem
@Ankit.yt_8852 жыл бұрын
Very Nicely Explained :)
@sketchwithbratati43973 жыл бұрын
Amazing explanation striver❤️👍🏻
@satyamchoudhary2573 Жыл бұрын
legend of explaination
@adarshrai95163 жыл бұрын
Bhai dheere dheere aap mere clg me famous ho rahe ho.Kaafi log abhi takeuforword channel se prep kar rahe.Sab din me ek baar puchhte hai SDE sheet ka kitna questions kiya bhai tune😂😂
@takeUforward3 жыл бұрын
Haha, dabakar share karo :P
@devkumaracharyaiitbombay5341 Жыл бұрын
bhai mind blowing your efforts in this video make my dsa journey easy love you so much bro. keep making this type of video in **WHITE BOARD
@sidharthjain72292 жыл бұрын
Sir why are we always picking the first position as optimal in the canPlaceCows function?
@aditya-st1sv3 жыл бұрын
Striver superstar🤩
@youngshahrukhkhan81793 жыл бұрын
Awesome Explanation
@subratarajak83913 жыл бұрын
Another masterpiece... ❤from CGEC bhaiya
@harshavardhanbashavathini65342 жыл бұрын
I did not understand, taking arr[0] for the first cow.(Greedy Approach). Please explain
@heyrmi3 жыл бұрын
Bhaiya it would be great if you can also tell the companies in which the questions are asked. Many of us don't even have a clue of frequency and company in which questions are mostly asked. It helps a lot
@takeUforward3 жыл бұрын
Sde sheet for that.
@arihantjha70623 жыл бұрын
I don't understand, why the first cow always has to be plased at the first given co-ordinate?
@chhatrapathisivajilakkimse81082 жыл бұрын
Exactly ! that's where I'm stuck . Like there could be other combination from the list which might get possible for given mid . Please can anyone explain this
@kavitgangar25102 жыл бұрын
Because we want to know whether we can place the cows at a min distance of 'dist'. So, if by placing the cow at the first co-ordinate, we cannot get a configuration where the dist between consecutive cows is >= dist, then by placing the first cow at any other position as well we wont get any configuration