#114. maxMirror
maxMirror
Background
Description
We'll say that a "mirror" section in an array is a group of contiguous elements such that somewhere in the array, the same group appears in reverse order. For example, the largest mirror section in {1, 2, 3, 8, 9, 3, 2, 1} is length 3 (the {1, 2, 3} part). Return the size of the largest mirror section found in the given array.
Format
Input
Output
Samples
[1 2 3 8 9 3 2 1]
3
[1 2 1 4]
3
[7 1 2 9 7 2 1]
2
Limitation
1s, 1024KiB for each test case.