package main
import"fmt"funcmaxProfit(prices []int) int {
// TODO: find the maximum profit from a single buy/sellreturn0
}
funcmain() {
fmt.Println(maxProfit([]int{7, 1, 5, 3, 6, 4})) // 5
fmt.Println(maxProfit([]int{7, 6, 4, 3, 1})) // 0
}
Click Run to execute, or Submit to grade (all languages).