Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Calculate the lifetime value (LTV) of a loyal customer.

Answered: 1 week ago

Question

Use service tiering to manage the customer base and build loyalty.

Answered: 1 week ago