Pls, help me to get recursive approach for this question.Minimum Time Traversal
Not able to think any recursive logic
Solution of the problem is a brute force, as range of n is 1<= n<= 5.
you have to consider all possible combination of using the n pipes and then select the one with minimum value.
Total number of combination would be: 32*120.
32 = 2^5= total number of set of n pipes,
120= 5!= all permutation of those n pipes, so for all set we will have max 120 permutation.
You can have a look at my code here. Just implemented Recursion and test cases passed. Have a look only if you are not able to implement yourself!
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.