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

Sdílet
Vložit
  • čas přidán 6. 01. 2023
  • This is the 3rd Video on our Maths Playlist.
    In this video we will try to solve an amazing and HARD problem "Max Points on a Line".
    We will do live coding after explanation and see if we are able to pass all the test cases.
    Problem Name : Max Points on a Line
    Company Tags : Google, Apple, LinkedIn, Amazon
    My solutions on Github : github.com/MAZHARMIK/Intervie...
    Leetcode Link : leetcode.com/problems/max-poi...
    My GitHub Repo for interview preparation : github.com/MAZHARMIK/Intervie...
    Subscribe to my channel : / @codestorywithmik
    ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
    ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
    ╠╗║╚╝║║╠╗║╚╣║║║║║═╣
    ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
    #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview #interviewtips
    #interviewpreparation #interview_ds_algo #hinglish

Komentáře • 65

  • @souravjoshi2293
    @souravjoshi2293 Před rokem +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

  • @souravjoshi2293
    @souravjoshi2293 Před rokem +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

  • @siddharthamishra7598
    @siddharthamishra7598 Před rokem +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!!! 💯

  • @shubhamraj5834
    @shubhamraj5834 Před rokem +4

    Beautiful solution loved it❤️

  • @sanikapatwardhan1590
    @sanikapatwardhan1590 Před 9 měsíci +2

    Thank you! This was very helpful

  • @saurabhN1393
    @saurabhN1393 Před rokem +3

    Your explanations are amazing, just love it.

  • @nagmakhan672
    @nagmakhan672 Před rokem +1

    Crisp and clean
    Thanks for the brute force again

  • @shivkumar-og4ow
    @shivkumar-og4ow Před rokem +3

    thanks a lot bhaiya, all concepts clear. love youuu

  • @wearevacationuncoverers
    @wearevacationuncoverers Před rokem +1

    Top Notch 🔥, beautifully explained

  • @rohitsoni5491
    @rohitsoni5491 Před 3 měsíci

    great video on this question :)

  • @omtopale75
    @omtopale75 Před rokem +1

    Bhai kadi acha samjha te ho.Bas lage raho

  • @devahuja9052
    @devahuja9052 Před rokem +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 !

  • @zaviyakhurshid9097
    @zaviyakhurshid9097 Před rokem +2

    Excellent loved it🤩

  • @shivsakthi37
    @shivsakthi37 Před rokem +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 🙌👏👏

  • @raisanjeeb42
    @raisanjeeb42 Před rokem +1

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

  • @girikgarg8
    @girikgarg8 Před rokem +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  Před rokem +1

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

  • @nishitalaxkar
    @nishitalaxkar Před 26 dny

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

  • @twi4458
    @twi4458 Před rokem +2

    Thanks for your topnotch explaination.

  • @MemeConnoisseur
    @MemeConnoisseur Před rokem +2

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

  • @gauravbisht516
    @gauravbisht516 Před rokem +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  Před rokem

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

  • @YashSinghal
    @YashSinghal Před rokem +2

    thank you :)

  • @Shubham-qc3me
    @Shubham-qc3me Před rokem +1

    Thanks bro, for always helping us.

  • @prabir8122
    @prabir8122 Před rokem +1

    What a nice explanation.
    Thanks a lot 😊

  • @priyanshugautam5648
    @priyanshugautam5648 Před rokem +2

    Book allocation, aggressive cow pleaseeeeee

  • @souradeep.23
    @souradeep.23 Před rokem +2

    wow 💯

  • @piyushacharya7696
    @piyushacharya7696 Před rokem +1

    Great Explanation Bro.👏👏

  • @arjuntyagi2919
    @arjuntyagi2919 Před rokem +1

    Great Explanation 😍

  • @oqant0424
    @oqant0424 Před rokem +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😅

  • @udaytewary3809
    @udaytewary3809 Před rokem +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  Před rokem

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

    • @udaytewary3809
      @udaytewary3809 Před rokem +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  Před rokem

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

  • @aiBeg6992
    @aiBeg6992 Před 2 měsíci

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

  • @AmandeepSingh-uq3wp
    @AmandeepSingh-uq3wp Před rokem +2

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

  • @abhinavkumar1356
    @abhinavkumar1356 Před rokem +2

    Thank you Brother😊😊

  • @sakshammisra189
    @sakshammisra189 Před měsícem +1

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

  • @top_g755
    @top_g755 Před 6 měsíci

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

  • @ec039venom4
    @ec039venom4 Před rokem +1

    can you make videos on contest questions also?

    • @codestorywithMIK
      @codestorywithMIK  Před rokem +1

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

  • @factsstats3959
    @factsstats3959 Před rokem

    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 Před 2 měsíci

      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