``` for(x in 0 until prices.size) { if...
# stdlib
a
Copy code
for(x in 0 until prices.size) {
            if(prices[x]<min) min=prices[x]
            else max=Math.max(max,prices[x]-min)
        }
on leetcode took 332ms
g
Also microbenchmarking of such things without proper benchmark harness is just waste of time But iterator is obvious difference in this case
1