Amazon Interview Question

Find Duplicate with various approaches