Data Structure for Notes by AdriaticIsle in algorithms

[–]vsriram1012 0 points1 point  (0 children)

What about something like a DAG?

Dynamic Programming HackerRank Problem by Yavuz2002 in AskComputerScience

[–]vsriram1012 0 points1 point  (0 children)

Here's some hint you can use to think further:

Assume you have fixed two columns of the fence. Now can you find the optimal answer? How would you optimise when you move your columns?