Loading Similar Posts
Problem Statement:
You have N ornaments made of gold placed in a row. You have been given an array of N positive integers representing the base price of each ornament. Every day, you choose to sell either the leftmost or the rightmost gold ornament.
If you sell an ornament on the Kth day, its price becomes K times its base price. Your task is to find and return an integer value representing the maximum amount you can earn by selling all of these gold ornaments.
Note: You sell exactly one gold ornament each day.
Input Specification: