While the Codechef MNMX problem is easy, I am trying to solve it by changing the constraint to following.
Select a pair of adjacent integers and remove the **smaller** one and keeping the larger one. ( while the original problem removes the **larger** one)
In original problem, We are removing the larger one and keeping the smaller one, so We can start with smaller one and do it n-1 times. So the sum_of_cost = (n-1) * min_element
How to solve it if we change the constraint to remove smaller one and keep larger one ?