Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 279 Bytes

README.md

File metadata and controls

12 lines (10 loc) · 279 Bytes

This question was asked by Google.

Given an N by M matrix consisting only of 1's and 0's, find the largest rectangle containing only 1's and return its area.

For example, given the following matrix:

[[1, 0, 0, 0],
 [1, 0, 1, 1],
 [1, 0, 1, 1],
 [0, 1, 0, 0]]

Return 4.