Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am learning dynamic programming concepts. I have recently stumbled upon this problem statement -

What I have tried:

I have tried masking the bits and brute force methods, but the results do not match.
Any leads on the approach would be helpful.
I am trying to solve the problem using C#, hence if someone can help me with the approach or solution in C# that would be appreciated so that I can correlate better.
Posted
Updated 1-May-18 15:19pm
v3
Comments
Patrice T 1-May-18 22:01pm    
Show your code.

1 solution

Quote:
Dynamic programming - order of operation

This problem is not related to 'Dynamic programming' unless your algorithm is very bad.
All the interest of those challenges is to proof your skills at finding the correct or best algorithm.

This problem is exactly the same as: Distance algorithm - minimum coins required to clear all the level[^] posted yesterday.
Quote:
I am seeking answers to get an insight on the approach to be taken to solve this problem.

Advice: Take a sheet of paper and a pencil and solve the problem by hand. Try bigger samples and see how you find best answer by hand. The way you solve the problem is your algorithm.
 
Share this answer
 
Comments
Maciej Los 2-May-18 2:15am    
5ed!
Patrice T 2-May-18 2:21am    
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900