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.
I'm going to prove the solution with O(n) time and O(1) space dosn't exist.
- ivanco June 06, 2012Let's make following assumptions that simplify the problem:
1) the array 'a' is sorted,
2) both arrays contain only unique elements.
To check that 'b' is permutation of 'a' we'll have to pick every element of 'b' and check whether it is in 'a'.
It is done with binary search in O(ln(n)) time.
It could not be done any faster even if we utilized information from the previous steps (removing elements already found in 'a', for example.)
So even in this, simplified case, the problem requires O(n*ln(n)) time to get solved.
Did I miss something?