asad.awadia
for(x in 0 until prices.size) { if(prices[x]<min) min=prices[x] else max=Math.max(max,prices[x]-min) }
gildor