You are given an integer array prices where prices[i] represents the price of the
Fruits are presented in order from the prices.
When acquiring fruits, you can follow these rules:
If you purchase the prices[i - 1] coins, you are eligible to claim the next
You may still decide to purchase a fruit even if you are allowed to claim it for free.
Return the minimum total number of coins required to collect all the fruits.
Constraints:
prices.length
prices[i]
You are given an integer array prices where prices[i] represents the price of the
Fruits are presented in order from the prices.
When acquiring fruits, you can follow these rules:
If you purchase the prices[i - 1] coins, you are eligible to claim the next
You may still decide to purchase a fruit even if you are allowed to claim it for free.
Return the minimum total number of coins required to collect all the fruits.
Constraints:
prices.length
prices[i]