Link to home
Create AccountLog in
Avatar of gnanagowthaman sankar
gnanagowthaman sankar

asked on

Can Anyone help me. Please explain the question i cant get it.

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.

maxMirror([1, 2, 3, 8, 9, 3, 2, 1]) → 3
maxMirror([1, 2, 1, 4]) → 3
maxMirror([7, 1, 2, 9, 7, 2, 1]) → 2
SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of gnanagowthaman sankar
gnanagowthaman sankar

ASKER

maxMirror([1, 2, 1, 4]) → 3   How 3 elements here 121 or 214 or 412 is not in sequence but how 3 elements
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.