You are viewing a single comment's thread. Return to all comments →
Go Golang Solution O(n)
func hurdleRace(k int32, height []int32) (diff int32) { max := int32(0) for i:=0;i<len(height);i++ { if height[i] > max { max = height[i] } } diff = max - k if diff < 0 { diff = 0 } return }
Seems like cookies are disabled on this browser, please enable them to open this website
The Hurdle Race
You are viewing a single comment's thread. Return to all comments →
Go Golang Solution O(n)