Question d’entretien chez Google

Two leetcode medium questions, each roughly 40 mins