Solution for strain using recursion.