Amazon Interview Question

Couldn't clear the initial rounds.