How do you solve it using recurion ?