Rod Cutting Profit

Given a rod of length length and an array prices where prices[i] is the selling price of a rod of length i+1, return the maximum profit obtainable by cutting the rod.

Examples
Input: [[1,5,8,9,10,17,17,20],8]
Output: 22
Hints
Related Problems

Rod Cutting Profit

Given a rod of length `length` and an array `prices` where `prices[i]` is the selling price of a rod of length `i+1`, return the maximum profit obtainable by cutting the rod.