规范格式

This commit is contained in:
YDZ
2020-08-07 15:50:06 +08:00
parent 854a339abc
commit 4e11f4028a
1438 changed files with 907 additions and 924 deletions

View File

@ -0,0 +1,22 @@
package leetcode
func maxArea(height []int) int {
max, start, end := 0, 0, len(height)-1
for start < end {
width := end - start
high := 0
if height[start] < height[end] {
high = height[start]
start++
} else {
high = height[end]
end--
}
temp := width * high
if temp > max {
max = temp
}
}
return max
}