in this video we have not given how many cuts we can do means there is n size rod so we can do n cuts but if we have given that we can only do 1 3 4 5 size cuts then how to implements it
Rod cutting problem
You can run for loop from 1 to 5 and build same recursive relation for that. For loop in the video is ensuring that the cut we do , doesn’t exceed by number n. Now as per your condition you can apply it in your code.
sir we can’t run a loop because we have given an array of cuts .
please visit this-https://leetcode.com/problems/minimum-cost-to-cut-a-stick/
It’s an advance problem of rod cutting problem.
do it when you completely understand the rod cutting problem. Read the explanation from here, it’s well explained.
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.