(matrix [][]byte)
| 27 | } |
| 28 | |
| 29 | func 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 | |
| 44 | func getArea(matrix [][]byte, x, y int) int { |
| 45 | maxArea := 0 |