Does ‘Minimum steps to one’ DP problem follow Optimal substructure property?
Does 'Minimum steps to one' DP problem follow Optimal substructure property?
How? Let us take 10 for example. so from 10, we could to to 9 and 5. The global optimal solution is achieved via 9, while the local optimal solution would be 5.
10 -> { 9 or 5 } right?
now which one is optimal among 9 or 5 ? it is decided by number of steps they(9->1 or 5->1) take to reduce to 1 and not by there magnitude value.
among these two whichever gives less step that will be optimal step.
Thank you. please help me close this thread by sending the rating link
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.