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.
Good Logic. You named it "brute-force" because of the step 3.2. In fact the step 3.2 can be optimized easily.
- xyz May 07, 2014The logic is:
Say the length of the number is k.
The number: [1][2][3][4][5][..][k]
Loop the array and each digit in the solution should satisfy:
1) s[i] > s[i-1]
2) s[i] >= n[i] (if the pre-fix are the same between s and n)
(s means solution and n mean the original number)
The only problem is that s might equals to n.
Then, increase 1 at the lower significance digit.
for example:
128 -> 129.
129 -> 134. (since 9 cannot increase, has to increase 2)
However, the final code is still pretty complex. Not easy to read by others.