Problem Statement | |||||||||||||
We want to buy a rectangular plot on a rectangular vegetable field. We want our plot to be as big as possible, but we only have the resources to grow a maximum of 2 different kinds of vegetables on it. You are given a String[] field, where each character represents a square in the field. All squares are of equal size. The j-th character of the i-th element of field denotes the kind of vegetable that grows in the square at row i, column j - it's an uppercase letter ('A' - 'Z'), where each letter denotes a different kind of vegetable. Return the area of the biggest plot we can buy. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | field will contain between 2 and 20 elements, inclusive. | ||||||||||||
- | Each element of field will contain between 2 and 20 characters, inclusive. | ||||||||||||
- | All elements of field will contain the same number of characters. | ||||||||||||
- | Each character in each element of field will be an uppercase letter ('A' - 'Z'). | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|