Holiday Accomodation - i

sir Don’t get it…how it will lead time complexity to n factorial (n! ) at 8:00 if we make all combinations
please explain this…

Hey @rupesh-4819
N! is the number of combinations
Say 1,2,3
Then possible combinations=3!=6
which are
1,2,3
1,3,2
2,1,3
2,3,1
3,1,2,
3,2,1

And then we check if all the conditions are met and then compute the answer
This will be brute force approach

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.

1 Like