Question: Java 2. We'll say that a mirror section in an array is a group of contiguous elements such that somewhere in the array, the same

Java

2. 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

3.Given a string and a non-empty word string, return a string made of each char just before and just after every appearance of the word in the string. Ignore cases where there is no char before or after the word, and a char may be included twice if it is between two words. wordEnds("abcXY123XYijk", "XY") "c13i" wordEnds("XY123XY", "XY") "13" wordEnds("XY1XY", "XY") "11"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!