Max Points on a Line -(Google, Apple, LinkedIn, Amazon) : Explanation ➕ Live Coding

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 71

  • @souravjoshi2293
    @souravjoshi2293 ปีที่แล้ว +5

    Literally har Qn me depth tak, different ways, brute force and what not.
    You provide so much information within just one video. This is just amazing

  • @siddharthamishra7598
    @siddharthamishra7598 ปีที่แล้ว +4

    This was your first video I have watched. Now, I am one of your subscribers. Loved the way you explained & thanks for your effort!!! 💯

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว +1

      Thank you so much Siddhartha ❤️❤️❤️

  • @souravjoshi2293
    @souravjoshi2293 ปีที่แล้ว +3

    Top Notch 🔥
    I no longer get scared of Hard Qns, I know that if I don't understand it, your videos will make it easy
    Thanks

  • @sanikapatwardhan1590
    @sanikapatwardhan1590 ปีที่แล้ว +2

    Thank you! This was very helpful

  • @wearevacationuncoverers
    @wearevacationuncoverers ปีที่แล้ว +1

    Top Notch 🔥, beautifully explained

  • @saurabhN1393
    @saurabhN1393 ปีที่แล้ว +3

    Your explanations are amazing, just love it.

  • @shivkumar-og4ow
    @shivkumar-og4ow ปีที่แล้ว +3

    thanks a lot bhaiya, all concepts clear. love youuu

  • @raisanjeeb42
    @raisanjeeb42 ปีที่แล้ว +1

    Explanation🔥🔥 ....Itna acha intuition syd hi kahi mile

  • @shubhamraj5834
    @shubhamraj5834 ปีที่แล้ว +4

    Beautiful solution loved it❤️

  • @devahuja9052
    @devahuja9052 ปีที่แล้ว +2

    Beautifully explained ! Helping a lot sir , I basically have a look at the daily q in the morning itself and if I'm unable to solve it by night I watch your video,
    keep up the good work......Thankyou !

  • @nagmakhan672
    @nagmakhan672 ปีที่แล้ว +1

    Crisp and clean
    Thanks for the brute force again

  • @twi4458
    @twi4458 ปีที่แล้ว +2

    Thanks for your topnotch explaination.

  • @nishitalaxkar
    @nishitalaxkar 4 หลายเดือนก่อน

    awesome explanation. Can you please provide the solution in java as well

  • @ce038_divanshsingh3
    @ce038_divanshsingh3 2 หลายเดือนก่อน

    you can also use simple map , and if( demominator is zero ) then use INT_MAX as key
    which is also fine

  • @omtopale75
    @omtopale75 ปีที่แล้ว +1

    Bhai kadi acha samjha te ho.Bas lage raho

  • @zaviyakhurshid9097
    @zaviyakhurshid9097 ปีที่แล้ว +2

    Excellent loved it🤩

  • @MemeConnoisseur
    @MemeConnoisseur ปีที่แล้ว +2

    13:26 I was dividing and getting cannot divide by 0 exception. Multiplying solves it :)
    Thanks again bhaiya.

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว +1

      Awesome
      Thanks a lot Rishav ❤️❤️❤️

  • @gauravbisht516
    @gauravbisht516 ปีที่แล้ว +2

    You teach great!! Also, in brute force method, if we start k from j + 1 then it reduces the TC and Run time becomes 8ms and beats 99% submission.

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      Awesome Gaurav. That was an important optimisation you mentioned.
      Thanks a lot ❤️❤️❤️

  • @souradeep.23
    @souradeep.23 ปีที่แล้ว +2

    wow 💯

  • @taimoorijaz3244
    @taimoorijaz3244 12 วันที่ผ่านมา

    Basically, it's not about costs means (/) isn't that way costly, its all about precision & comparity check, means sometimes makes ambiguity to compare float values & gives unexpected results.

  • @girikgarg8
    @girikgarg8 ปีที่แล้ว +4

    Bro tum contests ke bhi solutions discuss Karo please...especially of the fourth problem... nobody explains it well in the discuss section

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว +1

      Will soon plan Girik.
      Thanks a lot for sharing your suggestions ❤️

  • @shivsakthi37
    @shivsakthi37 ปีที่แล้ว +2

    Veryy wellll explained bro 🔥🤌 bro hope u continue to tell us brute force and optimal method like this one
    Concepts are clear--straight into head 🙌👏👏

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      Thanks a lot Harsh. ❤️❤️❤️
      Sure, always

  • @arjuntyagi2919
    @arjuntyagi2919 ปีที่แล้ว +1

    Great Explanation 😍

  • @piyushacharya7696
    @piyushacharya7696 ปีที่แล้ว +1

    Great Explanation Bro.👏👏

  • @prabir8122
    @prabir8122 ปีที่แล้ว +1

    What a nice explanation.
    Thanks a lot 😊

  • @rohitsoni5491
    @rohitsoni5491 7 หลายเดือนก่อน

    great video on this question :)

  • @Shubham-qc3me
    @Shubham-qc3me ปีที่แล้ว +1

    Thanks bro, for always helping us.

  • @udaytewary3809
    @udaytewary3809 ปีที่แล้ว +2

    You are really great bhaiya firstly when I was trying to solve the problem I also use the concept of slope that when all the pair of coordinate have same slope then we will have a straight line but I was wrong.
    But after seeing your vedio I got to know that where I was wrong my approach only count consecutive set of coordinate for which slope is same just like leetcode example no 1 and after seeing your vedio I got my doubt clear and for that I am really very thankful to you bhaiya

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      I am so glad.
      Thanks a lot Uday ❤️❤️❤️

    • @udaytewary3809
      @udaytewary3809 ปีที่แล้ว +1

      @@codestorywithMIK just wanted to ask one thing bhaiya in your second approach where you used map and in that approach you halve created map for for every i inside that each time the loop run there will be map created will that not be time and memory consuming
      Instead of that We will create a map outside the loop and when we got our result then we will clear the map is that will be right

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      Yes that approach is also good. Create a map outside, the clear it before every loop. Good one Uday 👍🏻

  • @brokegod5871
    @brokegod5871 หลายเดือนก่อน

    I thought of map approach first but didn't know there's a function inbuilt for tan

  • @abhinavkumar1356
    @abhinavkumar1356 ปีที่แล้ว +2

    Thank you Brother😊😊

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว

      Thanks Abhinav for watching ❤️❤️❤️

  • @priyanshugautam5648
    @priyanshugautam5648 ปีที่แล้ว +2

    Book allocation, aggressive cow pleaseeeeee

  • @oqant0424
    @oqant0424 ปีที่แล้ว +2

    What a timing. .... Though I coded it myself
    But I just came to your channel to see your approach but upload ni hui thi video... And then suddenly your video came😅

  • @YashSinghal
    @YashSinghal ปีที่แล้ว +2

    thank you :)

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว +1

      Glad I could help Yash ❤️❤️❤️

  • @nimishshinde5825
    @nimishshinde5825 25 วันที่ผ่านมา

    bro why store theta or gcd string where we can simply store dy/dx in the map handling div by 0 edge case?

  • @ec039venom4
    @ec039venom4 ปีที่แล้ว +1

    can you make videos on contest questions also?

    • @codestorywithMIK
      @codestorywithMIK  ปีที่แล้ว +1

      I will soon plan for this too.
      Slowly getting on track
      Thanks a lot for your suggestion 😊

  • @aiBeg6992
    @aiBeg6992 6 หลายเดือนก่อน

    One request, please also use Java language. like some of c++ function are not available in Java

  • @SumitYadav-q4s2s
    @SumitYadav-q4s2s หลายเดือนก่อน

    What if the length of points is 1e6?

  • @top_g755
    @top_g755 10 หลายเดือนก่อน

    Sir u are checking slope but what if lines are parallel means even then there slope will be same but lines are different 😢

  • @AmandeepSingh-uq3wp
    @AmandeepSingh-uq3wp ปีที่แล้ว +2

    Sir meine atan2 and _gcd ke bina hi kardiya isse accept hogaya tha. 🌝

  • @sakshammisra189
    @sakshammisra189 5 หลายเดือนก่อน +1

    mujhe laga tha maine map wla jo sol likha hai whi brute force hai but yha toh scene ulta hi tha lol

  • @factsstats3959
    @factsstats3959 ปีที่แล้ว

    It's failing for 34/35 test case
    [[2,3],[3,3],[-5,3]]
    Expected-3
    Output-2
    Please Help.
    .
    class Solution {
    public int maxPoints(int[][] points) {
    int n=points.length;
    if(n==1){
    return 1;
    }
    int max=0;
    for(int i=0;i

    • @aiBeg6992
      @aiBeg6992 6 หลายเดือนก่อน

      I checked in my IDE, your code works fine. Yeah but in leetcode ide, exception comes for [[2,3],[3,3],[-5,3]]--> Output=2 point but Expected=3 point

  • @gui-codes
    @gui-codes หลายเดือนก่อน

    L....E...G...E....N...D