Domanda di colloquio di Apple

Several questions requiring recursion/dynamic programming to solve.