Amazon interview question

Debugging, LeetCode medium/hard, Amazon Principles