Amazon interview question

It wasn’t leetcode style question