Google Coding Interview Question and Answer #1: Zero Sum Triplets
Vložit
- čas přidán 2. 05. 2019
- Google Interview Question and Answer #1: Zero sum triplets.
**** Best Books For Data Structures & Algorithms for Interviews:
1. Cracking the Coding Interview: amzn.to/2WeO3eO
2. Cracking the Coding Interview Paperback: amzn.to/3aSSe3Q
3. Coding Interview Questions - Narasimha Karumanchi: amzn.to/3cYqjkV
4. Data Structures and Algorithms Made Easy - N. Karumanchi: amzn.to/2U8FrDt
5. Data Structures & Algorithms made Easy in Java - N. Karumanchi: amzn.to/2U0qZgY
6. Introduction to Algorithms - CLR - Cormen, Leiserson, Rivest: amzn.to/2Wdp8rZ
Programming Interview Questions.
Zero Sum Triplets means finding 3 numbers from an array of integers whose sum is zero.
#Google #Interview #Programming
Share the videos if you like them. Knowledge Center has currently low number of subscribers.
I searched many videos but you way is best. Keep teaching
Thank you, I will
Nice. Please add more Google interview questions.. :)
Thanks. Working on that. Stay tuned.
One of the best video i found for this problem, thanks a lot sir
Glad it helped
The time complexity is n^2, right?
Great explanation. Thank you!
Glad you enjoyed it!
Ok so the time complexity for this is O(n^2) is it.
Here's what I've done
Sorting the array like you've mentioned O(n log n)
Iterating through each element in the array O(n)
Inside the loop, Using the two pointers technique O(n)
So the combined time complexity is O(n^2) due to the nested iteration and two pointers technique
Therefore the overall time complexity is
O(n log n)+O(n^2)=O(n^2)
You are way of explanation awesome. I am jabra fan of u.
Thanks.
Thanks for sharing.
Welcome.
thanks sir for your help
Always welcome
Nice Explanation
Thank you.
What will be the time complexity of the second approach?
Great explanation. Could you plz mention which IDE you are using?
Thanks. Xcode.
this won't work for duplicates values, right?
Can you please make a cheet sheet for dsa for fang companies please
These questions will be asked by Hyderabad Google company sir
You should add timestamp to each approach
Hi sir, this would be considered an easy or medium question for a google interview?
I think, Medium.
@@KnowledgeCenter Interesting, looks a quite simple for me, but maybe i just have enough practice in this kind of question.
sir please explain any useful solution for k sum .. ie for 2,3,4
Can you explain the exact problem?
@@KnowledgeCenter sir means same code is used for 4 sum with just little bit of modification.
Look at this: Subarray sum Equals K - czcams.com/video/YkacnIOt2jM/video.html
Is it what you are looking for?