Please elaborate?

when no people are there then the number of ways should be 0 how it could be 1

@namangarg31
You can think of it as if there are no people then their is only way to do it i.e. no one goes to party. It is also counted as a way.
If you are not getting this way thenYou can also think it as if n=2, then there will be 1 way that both goes alone and another way both goes together. so recurrence will be :
f(2) = f(1) + 1f(2-2) = f(1) + 1f(0) = 2, here if you take f(0) = 0 then it will give wrong answer.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.