add official solution, recursion.