Question d’entretien chez Amazon

The asked me a leetcode hard type problem