ACKO General Insurance interview question

Rod cutting problem in dynamic programming