Frage im Vorstellungsgespräch bei Apple

Several questions requiring recursion/dynamic programming to solve.