Amazon interview question

Find Duplicate with various approaches