Hundreds of array problems are solved with fewer than ten techniques. The skill interviewers are really testing is recognition: reading a problem and thinking "this smells like a sliding window". This lesson is your map; under each technique are the interview questions in this course that use it.
Walk the array once and keep a few variables up to date: the best so far, the cheapest so far, a running sum, a counter. Signals: a single answer about the whole array; "maximum", "minimum", "best time".
Free account
Sign up to read the rest of this lesson: 8 more sections.
Still to come