Amazon interview question

They asked Leetcode-style algorithm questions anyway.