Lecture 25: Binary Search Top Interview Problem | Book Allocation | Painter Partition | Ship Package

Поділитися
Вставка
  • Опубліковано 26 січ 2025

КОМЕНТАРІ • 272

  • @CoderArmy9
    @CoderArmy9  Рік тому +122

    First Question Concept is very Important, usko samjho achee se dry run karke, wo aagya, fr next 2 problem 2 min mein solve kar doge...
    There is one small correction in video, at 19:00 , when we are taking mid of 90 and 116 it should be 103 not 108. But that small mistake will not impact our answer, so keep going

    • @newglobal2056
      @newglobal2056 Рік тому +1

      ❤❤❤

    • @CHAUDHARY_PRAYAS
      @CHAUDHARY_PRAYAS Рік тому +3

      Mid of 90 and 116 is 103

    • @CoderArmy9
      @CoderArmy9  Рік тому +5

      @@CHAUDHARY_PRAYAS Thanks for pointing out, But it will not have any effect in our final answer.

    • @CHAUDHARY_PRAYAS
      @CHAUDHARY_PRAYAS Рік тому +3

      Bhaiya ek suggession tha
      Question ko brute force se start karke optimal Tak lejaiye kabhi kabhi kissi kisi question mein brute bhi nahi aata

    • @CoderArmy9
      @CoderArmy9  Рік тому +12

      @@CHAUDHARY_PRAYAS Bhai first question mein pehle brute force hi samjahya hai, uske baad binary search lagaya hai.. Aage se dhyan rkung ki brute force ka bhi code likhne ka pehle

  • @nullpointer500
    @nullpointer500 10 місяців тому +47

    Even high paid courses will not cover these complex problems in this simple way...... Lucky enough to get this free course

  • @imavinashsingh
    @imavinashsingh 10 місяців тому +10

    1:- Book Allocation (0:00:01)
    2:- Painter Partition (0:53:30)
    3:- Ship Package (1:08:30)

  • @tusharsingh7927
    @tusharsingh7927 11 місяців тому +12

    Lecture complete....ye lecture mera zindagi ka sbse important aur sbse hard rha....pr ab EASY lg tha 💀
    Thanku bhiya ❤

  • @A_bhi17
    @A_bhi17 10 місяців тому +5

    Rohit, bhai ki dedication ko dekh ke, maine apne life me kaafi changes laa paa raha hoo😊.
    Sach me Hats off you 🙏👏🏼

  • @shubhamkumarjha9192
    @shubhamkumarjha9192 Рік тому +8

    Bhaiya iss wali video ko friday se aaj tak atleast 7 se 8 bar dekha tab jaake kuch samjh aaya...

  • @ankittiwary9415
    @ankittiwary9415 4 місяці тому +1

    00:02 Binary Search Interview Problems
    02:21 Discussing the allocation of books with equal number of pages to two children.
    06:37 Using binary search to find the maximum number of pages that can be allocated to a child.
    08:29 Starting point selection based on maximum value in the array
    12:27 Using binary search to find minimum pages required for book distribution.
    14:18 Strategies for efficient binary search
    18:19 Algorithm for allocation of books based on binary search
    20:14 Explaining binary search concept with a practical example.
    23:48 Implementing logic for book distribution based on binary search
    25:46 Binary search algorithm in book allocation and student distribution.
    29:38 Understanding the distribution process for binary search
    31:30 Binary search algorithm explained with detailed example
    35:11 Explaining the logic behind book distribution
    36:56 Efficient distribution of specified values among children.
    41:15 Discussing binary search strategy for a problem
    43:21 Binary search algorithm for finding the answer within a range
    47:17 Binary Search for Book Allocation
    49:07 Determining if a valid book assignment is possible
    53:02 Discussing the Painter Partition problem
    55:09 Allocation of walls and painting time minimization
    58:35 Binary search algorithm to find optimal solution within constraints.
    1:00:17 Finding optimal time for completion of painting task
    1:03:53 Painter Partition Problem solving and implementation details
    1:05:48 Debugging errors related to data type overflow in code.
    1:09:30 Determining minimum weight capacity of ship for parcel distribution
    1:11:19 Understanding the binary search pattern for minimum and maximum problems

  • @MohitChaudhari-y7e
    @MohitChaudhari-y7e Рік тому +12

    Hey Rohit Bhai, you really are a baap teacher. Just keep continuing this project as if its your child.. Mai picche se aa rha hu and trust me, at the end of all this and while this is happening you will be among the very few Gurus that are actually able to teach. Thanks Man, bhai, Sir. We owe you a lot.. Love, Regards and Peace, thanks for being..,🙌✌

  • @theworld-zr5jp
    @theworld-zr5jp Рік тому +11

    Rohit bhai, I am specially writing this feedback to you,
    Bhai, day 33 pe aapne jo bhi sikhaya wo lecture maine us din dekha pr mujhe literally kuch bhi nahi samajh aaya aur iss cheez se frustrate hokar maine sat-sunday kuch bhi DSA nahi padha
    par aaj maine aapka 'QUIT CODING NOW' wala video dekha aur phirse aapka day-33 wala lecture study kiya and guess what muze poora concept samajh aaya aur maine saare questions bhi khud se kar liye..
    I don't know why this happened but I thought I should share this feedback with you therefore I am sharing this with you..
    ❤❤

  • @CSEBivekKumarSahNirala
    @CSEBivekKumarSahNirala Рік тому +3

    Bhaiya Navaratri ka bahut bahut subhkamna, Mata Rani aapko aur shakti de taki aap kavi thake nahi, aapka mehanat ham savi ke liye ek prerana jaisi hai
    Thaks Bahiya

  • @KunalIdnani
    @KunalIdnani 5 місяців тому +6

    Best teacher to learn dsa....
    sab chamak gya bhaiya....!

    • @slouchysenpai1970
      @slouchysenpai1970 5 місяців тому

      bhai kya aap khud se solve kar parahe ho

    • @adityarajsinghrathor
      @adityarajsinghrathor 5 місяців тому +1

      ​@@slouchysenpai1970 bro yeh problem naah, question practice se solve hogi. First do easy level problem from gfg then medium level then move to leetcode.

    • @slouchysenpai1970
      @slouchysenpai1970 5 місяців тому

      @@adityarajsinghrathor thanks bhai

  • @karankumar3983
    @karankumar3983 Рік тому +2

    00:00 q1 and 43:00 conclusion or summary, 49:00 it's code, 53:30 q2 1:04:54 code of q2 , 1:08:32 q3

  • @mayankbijlwan1082
    @mayankbijlwan1082 3 дні тому +1

    i am not able to understand book allocation problem till 2 days and so confused then i serch other creator like apna collage,striver and love bababr videos and they are more complex to understand then i dry run this code by myself and then again watch your video and now i completely understood and this is the best method to solve this problem on youtube

  • @greatindianfood6962
    @greatindianfood6962 Місяць тому

    After watching so much videos on this topic, I didn't understand this. But from your detailed explanation everything is crystal-clear. Thank you!.

  • @abhi_coder6
    @abhi_coder6 Рік тому +5

    Baap of DSA Rohit bhaiya 😊itna aacha se kon samjhta h bhaiya, just like mom teaches her newborn baby ❤.

    • @shreyasshinde1981
      @shreyasshinde1981 10 місяців тому

      in first problem what is M ?

    • @abhi_coder6
      @abhi_coder6 10 місяців тому

      @@shreyasshinde1981 m is the number of students jinke bich books ko distribute karne h

  • @deepsanyal2
    @deepsanyal2 11 місяців тому +1

    Wow wow wow !!! No one can teach this concept better than you Rohit bhai you are genius ❤🎉

  • @Yogesh_Singh_1350
    @Yogesh_Singh_1350 11 місяців тому +1

    Thank you brother..... boht dino se stuck tha esi question mai... video dekh kr clear ho gya......

  • @anupammishra6514
    @anupammishra6514 Рік тому +3

    Bhaiya you are awesome 💯😎 .......you are the best teacher........sare concept direct mind me 👍🙂❤️.....best explanation ❤

  • @heyMonikaa
    @heyMonikaa 6 місяців тому +2

    I cannot appreciate less, the content and the hard work youre providing is just unbeatable, thankyou so so so sooooo muvh bhaiyaa flr your efforts, our blessings are with you, keep doing great ✨

  • @Updatedknowledge9
    @Updatedknowledge9 Рік тому +2

    Lagta hai, Rohit bhaiiya ka, placement ka record coder army tod dega,
    Best explanation on UA-cam of book allocation and below all topic
    Epic explanation ❤❤❤

  • @Deb-k8k
    @Deb-k8k Рік тому +1

    I dont comment on any video this problem was a nightmare for me but your logic was crystal clear thank you.🤩🙏

  • @anupamatul9393
    @anupamatul9393 11 місяців тому +1

    The most Difficult lecture but you make it easy...

  • @Himanshu_85-e2i
    @Himanshu_85-e2i Рік тому

    bhaiya mai apka lecture roj rat me 2 baje dekhta hu kyuki exam chal rahi hai na abhi isiliye or ap vedio ke ant me jo kahte hai na ki agar lecture pasand aya ho to video ko like kar do to mai like kar ke hi jata hu nahi to bhula jata hu achchha hai ki ap hame yad dila dete ho

  • @AhmadRaza-b6q3r
    @AhmadRaza-b6q3r 21 день тому

    love you bhaiya watching your series in 2k25, really helpful

  • @Shakil27224
    @Shakil27224 Рік тому

    Hello bhaiya aisa video aise consistency UA-cam mai pehli bar dekh Raha hu 🙏🏻🙏🏻🔥

  • @JatinKansal-z5b
    @JatinKansal-z5b Рік тому +1

    Thanks bhaiya to make me understand the book allocation problem really u have good teaching skills in dsa

  • @akhil-slfimp
    @akhil-slfimp 11 місяців тому +3

    IT REALLY GOOD EXPLANATION KISKI KO SMAJH N AYA NA AGAR SO DONT WORRY BAAR BAAR REVISE KRO JUST LIKE ME(3RD TIME REVISITING THIS VIDEOOOOO ) AND HO JAEGAA ISKE SAASTH K QUESTION KRO WE GOOOOD

  • @Gyanendra012
    @Gyanendra012 4 місяці тому

    38:00 Best part of 1st problem is agar 3 me distribute kar pa rha hu to 4 me bhi ho hi jayega and vise versa is not true....

  • @rohanbarwade578
    @rohanbarwade578 5 місяців тому

    Best channel for DSA & competative programming geek🤍🤍🤍Thankyou rohit bhai

  • @IM-wo1be
    @IM-wo1be 10 місяців тому +1

    Thanks bhaiya for providing such kind of amazing content on youtube.

  • @Piyush_sahu.1
    @Piyush_sahu.1 6 місяців тому +1

    Never seen these kind of lecture love you

  • @satyam6943
    @satyam6943 Рік тому +3

    It's too hard to understand the first question but atleast i understood everything and going to do the hw thank you bhaiya . Jay shree Ram 🚩

    • @BadalJena-oh6qu
      @BadalJena-oh6qu 11 місяців тому

      bhai agar tumne ye course kiya he to kya ek baar review de sakte ho. Me love babbar ka dsa course kar raha tha lekin mujhe thoda understanding me problem a rha he.

  • @pratapkumar7249
    @pratapkumar7249 11 місяців тому

    bhaiya aapne sare question bahut hi aasani se explain kiya h

  • @chaitanyadeshmukh1017
    @chaitanyadeshmukh1017 3 місяці тому

    thank you sir i understand all concept your teaching style is awesome
    😘

  • @BadalJena-oh6qu
    @BadalJena-oh6qu Рік тому

    Thanks bro I wasn't able to understand it from love babbar's video, but now it's clear to me.

  • @priyanshuarya6317
    @priyanshuarya6317 4 місяці тому

    Each and every doubts are clear to related these type of binary search problem thanks sir ❤

  • @Shauryousee
    @Shauryousee 6 місяців тому

    idk why , maybe im dumb but from 7:00 to 8:30 im having loads of problem trying to understand the method you're trying to explain bhaiya 😢😢
    EDIT: AA GAYA AND SOLVE HO GAYA BHAIYAA❤

    • @sumitsharma4570
      @sumitsharma4570 5 місяців тому

      Bro same situation 😂😂😂 I am still trying to understand

  • @Himanshu_85-e2i
    @Himanshu_85-e2i Рік тому

    bhaiya apka samjhane ka tarika jo hai na bahut mast hai aur samajh me bhi aa jata hai

  • @darshanrishabhdz
    @darshanrishabhdz 2 місяці тому

    day of dsa 25 lecture complete..... thank you bhaiya

  • @arpitkhandelwal8280
    @arpitkhandelwal8280 6 місяців тому +3

    amazing lecture bhaiya ...dimaag khul gya ek dum !!! Jai Hind Jai Bharat

  • @shreyoshighosh3818
    @shreyoshighosh3818 7 місяців тому

    bhaiya book allocation itne acche se samjh m aya ki bki 2 problem khud kr liya

  • @yadiencollection5073
    @yadiencollection5073 Рік тому +1

    Good morning techies
    Mess se aa gya ab start krta hu
    Ram ram Rohit bhaiya🙏

  • @KNOWLEDGEBLE01
    @KNOWLEDGEBLE01 Місяць тому

    Chamka diye bhaiya
    Maja aa gya
    Book allocation Mai to

  • @sumitmishra3864
    @sumitmishra3864 Рік тому

    bhai next level explanation ab is type ke question kaise bhi kar sakte h aisa lg rha h in sbko solve karke

  • @Error-td8fm
    @Error-td8fm Рік тому +1

    Aapne pahle question me time complexity NlogN batayi jabki start aur end nikalne ke liye bhi for loop chal raha hai toh time complexity hui n²logn aur ye code jo aap diye h wo time exceed kar raha h gfg me

  • @HEMANTRAJ-MNNITian
    @HEMANTRAJ-MNNITian 7 місяців тому

    bhaiya, literally faced around 5 same pattern question on leetcode , in medium and hard section, after this video I was able to solve all of them

  • @patanwar
    @patanwar 10 місяців тому

    You're literally an Inspiration for us 👑✍🏻

  • @computerscience68
    @computerscience68 Рік тому +1

    BHai agr ye series 3rd year me mil jaati to mujhe dsa me bahut help milti

  • @dancewithme2005
    @dancewithme2005 Рік тому +1

    Day 33 Successfully Completed 1:13:13 💪

  • @youtubersfanpage7392
    @youtubersfanpage7392 Рік тому

    thank you @rohitnegi bhaiya to make a easier concept to a tough concept and also for a great explanation.

  • @sachinprajapati815
    @sachinprajapati815 Рік тому

    book allocation problem always goes above my head. but this time you made me understand and thanks for that sir ❤❤❤❤❤❤❤❤

  • @Coderscrib
    @Coderscrib Рік тому

    Thanks you so much bhaiya. You make every problem easily understandable.

  • @TheSakshi-rm4hv
    @TheSakshi-rm4hv Місяць тому +1

    He is god father of DSA ❤

  • @Kalamkaar2607
    @Kalamkaar2607 Рік тому +4

    Time and space complexitymathematical proof .Pls bhaiya on this weekend .

  • @PrashantKumar-gy1qs
    @PrashantKumar-gy1qs Рік тому

    Literally mind blowing teaching...

  • @AnshuGupta-xw8ly
    @AnshuGupta-xw8ly 9 місяців тому

    thanks for your effort yo ur teaching skills realize me that even I can do so much in codiing which was fear to me earlier 🙂

  • @hardiksharma4189
    @hardiksharma4189 11 місяців тому

    Nice explanation bhaiya....saree question smjh aagye

  • @-BCS-VarshaVaishnav
    @-BCS-VarshaVaishnav Рік тому

    33/180 done thanku so much bhaiya hme itna acha padhane ka liye🥺🙃

  • @startercoder
    @startercoder Рік тому

    it was really nicely explained, now I am able to see the pattern in binary search

  • @Shauryousee
    @Shauryousee 6 місяців тому

    lecture+hw done (all except koko solving bananas)
    amazing lecture learnt a lot out of this!!!
    ❤❤

  • @physchetics4392
    @physchetics4392 10 місяців тому

    kaffi help ho rha aapke vedio se sikha hu but kuch or avi continue kr rha hu aapka lecture

  • @Beachreflection
    @Beachreflection 9 місяців тому

    48:00 while loop and for loop ki time complexity kese pta chla ?

  • @mohammad-aman1105
    @mohammad-aman1105 Рік тому

    Bhaiya video to late aai par 33 days completed.Ab 2 din revision karna hai, milte hai Monday ko. Thank you Bhaiya ❤❤❤❤

  • @Amanyadav-99v
    @Amanyadav-99v 2 місяці тому +1

    love you bhaiya

  • @Proxy_army
    @Proxy_army 9 днів тому

    ye batao kya video dekh ke sekhna sahi hota hai kya kyui jab mene problem dekhi to mujhe amjh nhi aa rah tha par video dek kar sekhna sahi hai kya

  • @DhanushAg-sh9qp
    @DhanushAg-sh9qp 7 місяців тому

    its amazing session and
    very helpful

  • @Nebula_official_25
    @Nebula_official_25 Рік тому

    world class consistency .... All time love my negi bhai❤❤

  • @varunprajapati5838
    @varunprajapati5838 12 днів тому

    bhhout bhhout shukriya mere bhai

  • @joydeep-halder
    @joydeep-halder Рік тому +1

    HW Solution 4: Koko Eating bananas ✅✅
    int minEatingSpeed(vector& piles, int h) {
    int start = 1, end = 0, mid, ans, n = piles.size();
    for(int i=0; i

  • @I_am_loki_of_asgard988
    @I_am_loki_of_asgard988 6 місяців тому +3

    Bhaiya dimag ghum gaya😂😂

    • @Radhe55
      @Radhe55 3 місяці тому

      😂😂 same bro

  • @dataScience7845
    @dataScience7845 Рік тому

    Explaination are very good and simple.

  • @RiyaKashyap-ev3sm
    @RiyaKashyap-ev3sm 5 місяців тому +1

    Bhaiya ship package vala code ek baar aap implement krke dikha do plz bhaiya maine bhot krne ki try kra but nhi ho pa reha plz bhaiya

  • @Sony_47
    @Sony_47 Рік тому

    (90+116)/2 = 108 ? ... aadhe ghante pareshan raha m .
    and thank you so much great explanation...

  • @visverthedepthofphysics6297
    @visverthedepthofphysics6297 9 місяців тому

    Good effort by you, Bhaiya!!!

  • @RoyHimadri1605
    @RoyHimadri1605 5 місяців тому

    Thank you bhaiya for this beautiful lecture

  • @pratyakshamaheshwari8269
    @pratyakshamaheshwari8269 4 місяці тому

    Thanks, I learnt it very easy way.

  • @saitanush9453
    @saitanush9453 8 місяців тому

    Tq bhaiya, i am happy to understand the concept

  • @alisherkhann_
    @alisherkhann_ 11 місяців тому

    best video on BS on answers

  • @Engineering_student_2026
    @Engineering_student_2026 Рік тому

    Best explanation method ❤❤

  • @atharvpitrubhakta4554
    @atharvpitrubhakta4554 Рік тому

    Day 33 Successfully Completed ✅✅& Consistency++

  • @YT_Fresher
    @YT_Fresher Рік тому +1

    love you sir😘

  • @asteroiddestroyer-c6g1v
    @asteroiddestroyer-c6g1v 2 місяці тому

    book allocation samjhne main thora waqt laga lekin bad ki dono problems easy lagin.
    chamka++;

  • @the_pjd
    @the_pjd 7 місяців тому +1

    bariya tha sir

  • @tarunaggarwal8065
    @tarunaggarwal8065 7 місяців тому

    bhaiya kaafi achhe se samajh aa gya ❤

  • @manish_kumar_iitg
    @manish_kumar_iitg 7 місяців тому

    time stamp 49:00

  • @Pallab01
    @Pallab01 Рік тому +1

    Subha sasthi Sir ❤❤

  • @prakashbaria
    @prakashbaria Рік тому

    Very interesting concept covered today, Appreciate a lot.
    🙏☝☝

  • @lyrafiel76
    @lyrafiel76 11 місяців тому

    Superb explanation.

  • @qslyr49673
    @qslyr49673 11 місяців тому

    Great Explainer...👌

  • @rohitgupta3305
    @rohitgupta3305 Рік тому

    The link you gave on the WhatsApp group for resume workshop is not working. That's why I can't fill out the form. Please resend it or make it ok.

  • @rohitkr.6408
    @rohitkr.6408 Рік тому

    Day-33 Completed🔥
    #180daysofcode
    covering backlogs

  • @IndianKite1234
    @IndianKite1234 Рік тому

    excellent teaching

  • @cybrarygamer486
    @cybrarygamer486 Рік тому

    Bhaiya payment karne karne par garphy Pvt limited aa raha hai

  • @sujitsrivastava3392
    @sujitsrivastava3392 4 місяці тому

    maja aya bhaiya mind me fixed ho gaya

  • @santanudebnath1283
    @santanudebnath1283 Рік тому

    bro leetcode meh try kiya but error aaraha hyy

  • @daily-motivaion
    @daily-motivaion Рік тому

    great explanation bhaiya❤

  • @OsamaShabih
    @OsamaShabih 2 місяці тому

    Chamak gya sir jii ❤

  • @newglobal2056
    @newglobal2056 Рік тому +1

    Bhaiya Koko eating bananas ye problem ko chod ke sare problem ban Gaye kal please Koko eating bananas wala Thora samjha dijia ga...

  • @Gamerz-g4i
    @Gamerz-g4i 4 місяці тому

    Best explaination

  • @adparikhyt8859
    @adparikhyt8859 Рік тому

    Brother, can we prepare dsa for gate cse from this course?