Amazon interview question

Non disclosure agreement. Check leetcode