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 not sure but this is what I came up with. Since you can't use any extra space, you use the space given to you. How? You divide the list into processed parts and non-processed part. The processed part is from head to tail, this sub-list is where we linearly maintain uniqueness. The non process part is from tail to end of the list.
You start with tail at the beginning of the list. As you go through each node, you check if the node is already in the sub list [head, tail], if not increase the tail since the node is unique and that it includes the current node in this processed list that we are maintaining to be unique. If it is already in there, we delete the current node and check the next one. Notice how we aren't incrementing tail because the current node was a duplicate and we only want unique nodes in the sub list of [head,tail].
The time complexity is O(n). Space is O(1). Can anyone confirm if I did this right? Thoughts?
- kier August 23, 2013