Possible duplicate: http://stackoverflow.com/questions/2301733
I need help with a problem.
Given a MxN
board represented with M
letters (a-z) in each of the N
lines, i have to find the biggest area in which there are only 2 types of letters in it. The area must have rectangular shape. Here's an example :
4x4:
AAAA
ABBC
BBCA
DCAA
The output will be 6, because the biggest rectangular area in which there are only 2 types of letters is in the upper corner AAA-ABB, there are only A and B (2 types).