Daily Rounds interview question

Question realted to arrays and recursion.