Given a rod of length n and prices for different lengths, determine the maximum revenue obtainable by cutting up the rod and selling the pieces. Unlimited pieces allowed.
{
"price": [
1,
5,
8,
9,
10,
17,
17,
20
],
"n": 8
}22{
"price": [
3,
5,
8,
9,
10,
17,
17,
20
],
"n": 8
}24{
"price": [
2,
5,
7,
8
],
"n": 4
}10Sign in to Run Code and Submit