MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / max

Function max

go/0152-maximum-product-subarray.go:14–19  ·  view source on GitHub ↗

Golang does not have a built-in max for integers

(a int, b int)

Source from the content-addressed store, hash-verified

12
13// Golang does not have a built-in max for integers
14func max(a int, b int) int {
15 if (a > b) {
16 return a
17 }
18 return b
19}
20
21// Golang does not have a built-in min for integers
22func min(a int, b int) int {

Callers 1

maxProductFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected