Question d’entretien chez Amazon

Coding interview had 2 problems with dsa.