Nice DP solution. However, I got a hard time initially to understand the correctness of this algorithm. The following statement seems pretty confusing to me:
Let the maximal rectangle area at row i and column j be computed by [right(i,j) - left(i,j)]*height(i,j).
Actually, that single expression cannot guarantee it is the largest maximal rectangle containing (i, j) and up to row i. It is actually, the tallest rectangle containing (i, j) and up to row i while making as wide as possible.
And the key point is that the global maximal rectangle must be a such tallest rectangle somewhere at (i, j).