Max Points on a Line -(Google, Apple, LinkedIn, Amazon) : Explanation ➕ Live Coding
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
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
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
This was your first video I have watched. Now, I am one of your subscribers. Loved the way you explained & thanks for your effort!!! 💯
Thank you so much Siddhartha ❤️❤️❤️
Beautiful solution loved it❤️
Tysm ❤️❤️❤️
Thank you! This was very helpful
Glad it was helpful! 🙏😇
Your explanations are amazing, just love it.
Thanks a lot Saurabh ❤️❤️❤️
Crisp and clean
Thanks for the brute force again
thanks a lot bhaiya, all concepts clear. love youuu
So glad to help Shiv. 💪❤️
Top Notch 🔥, beautifully explained
great video on this question :)
Bhai kadi acha samjha te ho.Bas lage raho
Thank you so much ❤️❤️❤️
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 !
Thanks a lot Dev ❤️❤️❤️
Excellent loved it🤩
Thanks a lot 😇😇😇
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 🙌👏👏
Thanks a lot Harsh. ❤️❤️❤️
Sure, always
Explanation🔥🔥 ....Itna acha intuition syd hi kahi mile
Thank you so so much Sanjeeb ❤️
Bro tum contests ke bhi solutions discuss Karo please...especially of the fourth problem... nobody explains it well in the discuss section
Will soon plan Girik.
Thanks a lot for sharing your suggestions ❤️
awesome explanation. Can you please provide the solution in java as well
Thanks for your topnotch explaination.
Thank you so much for watching 😇❤️
13:26 I was dividing and getting cannot divide by 0 exception. Multiplying solves it :)
Thanks again bhaiya.
Awesome
Thanks a lot Rishav ❤️❤️❤️
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.
Awesome Gaurav. That was an important optimisation you mentioned.
Thanks a lot ❤️❤️❤️
thank you :)
Glad I could help Yash ❤️❤️❤️
Thanks bro, for always helping us.
Anytime 👍🏻❤️
What a nice explanation.
Thanks a lot 😊
Thanks a lot Prabir ❤️❤️❤️
Book allocation, aggressive cow pleaseeeeee
Soon ❤️❤️❤️
wow 💯
Thanks a lot ❤️❤️❤️
Great Explanation Bro.👏👏
Thanks a lot ❤️❤️❤️
Great Explanation 😍
Thanks a lot Arjun ❤️❤️❤️
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😅
❤️💪
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
I am so glad.
Thanks a lot Uday ❤️❤️❤️
@@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
Yes that approach is also good. Create a map outside, the clear it before every loop. Good one Uday 👍🏻
One request, please also use Java language. like some of c++ function are not available in Java
Sir meine atan2 and _gcd ke bina hi kardiya isse accept hogaya tha. 🌝
Awesome
Keep it up 👍🏻💪💪
Thank you Brother😊😊
Thanks Abhinav for watching ❤️❤️❤️
mujhe laga tha maine map wla jo sol likha hai whi brute force hai but yha toh scene ulta hi tha lol
Sir u are checking slope but what if lines are parallel means even then there slope will be same but lines are different 😢
can you make videos on contest questions also?
I will soon plan for this too.
Slowly getting on track
Thanks a lot for your suggestion 😊
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
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