while ```prices.forEach { maxProfit = maxOf(ma...
# stdlib
a
while
Copy code
prices.forEach {
    maxProfit = maxOf(maxProfit, it - minPrice)
    minPrice = minOf(minPrice, it)
  }
took 420ms