public class Solution { /** * * @param prices int整型一维数组 * @return int整型 */ public int maxProfit (int[] prices) { int len = prices.length; Stack<Integer> s = new Stack<>(); // 可以在 prices[len] 位置放一个 -1 的哨兵 // 这样可以让单调递增的数组中所有的元素逼出去 int ans = 0;...