import java.util.*; class Solution { public int maxProfit(int[] prices) { // write code here int buy = prices[0]; int money = 0; for (int i = 1; i < prices.length; i++) { if ( buy < prices[i]){ money = Math.max(money,prices[i] - buy); }else { ...