CarGurus interview question

Leetcode/Hackerrank style do questions (easy).