Amazon Interview Question

coding dsa one medium and hard