Domanda di colloquio di Google

OA, two questions, i would say leetcode medium