Apple Interview Question

write recursive functions