Amazon interview question

Typical Leetcode-style algorithms & data structures