Question d’entretien chez Amazon

two coding questions of difficulty level leetcode medium