Question d’entretien chez Google

2 simple tasks - one based on recursion, one based on array traversal