You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. Return the maximum profit you can achieve.
Greedy
Collect every upward move — any rising segment contributes to profit.