HashedIn by Deloitte interview question

Dynamic Programming program of rod cutting