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 think first we should make sure the encoding of the string (i.e. the number of bits that can represent 1 character).
- bcp1989 November 20, 2012If the encoding is ascii, we can use two bitmap (each has 255 bits) to solve this problem. Bitmap A is used for remembering if the character appeared once, and bitmap B is used for remembering if the character appeared more than once. We need another integer array (capacity 255) to remember the last time a character appeared, then the problem will be solved. Time complex is O(n), space complex is O(1) (255bits * 2 + sizeof(int) * 255)
If the encoding need many bits to represent a character, we can use multi-level bitmap structure to reduce the memory cost.