Domanda di colloquio di Meta

Algorithm questions, both were really easy