Recursion is when a function calls itself! It's like looking into two mirrors facing each other — images within images within images... 🪞
💡 Think of it like this: Russian nesting dolls (matryoshka). To find the smallest doll, you open the big one, find a smaller one inside, open that, find an even smaller one... until you reach the tiniest doll (that's your base case!).
Every recursive function needs:
Pro tip: When stuck with recursion, ask yourself: "If I had the answer to a smaller version of this problem, how would I use it to solve the bigger problem?"
sum_to_n(5)
15
sum_to_n(10)
55