class Solution { public int maxProfit(int[] prices) { int result=0; for(int i=1;i