Google interview question

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