Zorigt.Baz

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.
My solution is to iterate over the list once. First make a temp copy of the list and then iterate over the list. While iterating, if the number is negative then pop it out of the temp list and then add it back to the end of temp list. For the positive numbers, do the opposite which is to pop the number out from the temp list and then add it to the front of the temp list, which also a reverse order for the positive numbers. Keep track of count for positive numbers, so you can slice the final temp list into positive and negative lists. Now, you just need to reverse the positive list and append the two lists into a single list as a return value.
[-1,1,3,-2,2]
After iterating over the original list
[2,3,1,-1,-2]
After slicing by positive-integer count
[2,3,1] [-1,-2]
After reversing positive list
[1,3,2] [-1,-2]
Return
[-1,-2,1,3,2]
- Zorigt.Baz August 25, 2016