is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
1. Take the set of numbers which are all unique, duplicate the set
2. From the duplicated list subtract the difference value (2) from each element
You get: 1 5 3 4 2 and -1 3 1 2 0
3. Do a set intersection of the original set and duplicated set
4. The count of elements in the intersection gives you the list of numbers where the difference between the 2 numbers == to the difference value you set
Going through the list is O(n) and set intersection is
- s.shrinidhi February 21, 2014Average - O(min(len(s), len(t))
Worst - O(len(s) * len(t))
If they specify only positive integers you can skip inserting any number where number - difference < 0 and that will reduce the size of the duplicate set and make your intersection go a little faster.