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.
Since it is mentioned that the sorting does not need to be in place, use of bucket sort would do the sorting in O(n).
- sg3639@g.rit.edu September 11, 2017Since, it is given that every element can only range from 1 to 10, we can have an HashMap having each 1 to 10 as keys and their corresponding counts as values. After one iteration over the array, we get all the counts in the HashMap, which we could then use to updated the array with sorted elements.