5 ms·
This wasn't a problem in the exercise section. This was simply a problem solved to explain a concept. So I didn't really peek at any solution. I was supposed to
by fzkl 17y ago
This wasn't a problem in the exercise section. This was simply a problem solved to explain a concept. So I didn't really peek at any solution. I was supposed to see this solution as an example to understand one of the methods of problem solving using recursion. (not denying that I could have tried to figure it out on my own instead of reading further in the main text)
But I agree with your last two sentences.