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.
n is the number of intervals in input.
Time complexity of this implementation is O((n*logn)^2)
Can be optimized to O(n*n) by replacing std::map with an ordered-hash implementation.
Idea is to construct a cost_map.
For each interval <f, l> in input, insert key f and key l into cost_map.
cost_map[k] contains:
1) Adjacency vector = [<k,i> for all <k,i> in set of intervals]
2) Least cost to destination (initialized to infinity)
Traverse keys in cost_map from highest to lowest.
For each interval <k,last> in cost_map[k]
update cost_map[k]'s least_cost to destination.
For each i such that k < i <= last, update least_cost at cost_map[i]
cost_map[0]'s least_cost is the cost to the destination. If it is infinity, return -1.
- Kevin Francis June 07, 2016