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.
This problem isn't very simple. The naive method is testing all the combination. The time complexity of that is O(n^2). Mukesh has gave us this answer. I think this question should be used dynamic programming method. We can list some special testcases:
- Tao Z. August 16, 201300101010100: 8 two times the less number
00000100000: 2 two times the less number
10111111010: 4 two times (the rightest subarray)
10111010110: 4 two times (the middle subarray)
The problem of all the solutions is how to decide when the subarray start and end with the same number which is also the smaller count of 1's and 0's.