Skip to content

Commit 171c28a

Browse files
committed
Add max function in 1004
1 parent 796861b commit 171c28a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

website/content/ChapterFour/1000~1099/1004.Max-Consecutive-Ones-III.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ func longestOnes(A []int, K int) int {
7777
return res
7878
}
7979

80+
func max(a int, b int) int {
81+
if a > b {
82+
return a
83+
}
84+
return b
85+
}
86+
8087
```
8188

8289

0 commit comments

Comments
 (0)