MCPcopy Create free account
hub / github.com/VanjaRo/LeetCode / maximalRectangle

Function maximalRectangle

tasks/85.go:29–42  ·  view source on GitHub ↗
(matrix [][]byte)

Source from the content-addressed store, hash-verified

27}
28
29func maximalRectangle(matrix [][]byte) int {
30 area := 0
31 for i := 0; i < len(matrix); i++ {
32 for j := 0; j < len(matrix[0]); j++ {
33 if matrix[i][j] == '1' {
34 newArea := getArea(matrix, i, j)
35 if area < newArea {
36 area = newArea
37 }
38 }
39 }
40 }
41 return area
42}
43
44func getArea(matrix [][]byte, x, y int) int {
45 maxArea := 0

Callers 1

mainFunction · 0.85

Calls 1

getAreaFunction · 0.85

Tested by

no test coverage detected