Problem Statement | |||||||||||||
You will be given two grids of pixels, where each pixel has an ASCII value between 32 and 126, inclusive. Your task is to find the size of the largest square subimage that occurs in both grids. A square subimage of size k is a square region of the input covering pixels from (i,j) to (i+k-1,j+k-1). A square subimage of size k exists in both grids if there exists some (i',j') such that the pixel at (i+x,j+y) of imageA has the same value as the pixel at (i'+x,j'+y) of imageB from all non-negative x and y less than k. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | imageA and imageB will each contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of imageA will contain the same number of characters. | ||||||||||||
- | Each element of imageB will contain the same number of characters. | ||||||||||||
- | Each element of imageA and imageB will contain between 1 and 50 characters, inclusive. | ||||||||||||
- | Each character in imageA and imageB will have ASCII value between 32 and 126, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
|