Question: You have two strings, a and b . Find a string, s . such that: s can be expressed as s = s 8 +
You have two strings, a and Find a string, s such that:
s can be expressed as where is a nonemply substring of a and is a nonempty rubstring of
s is a palindromic string.
The length of s is as long as possible.
For each of the pairs of strings and : received as input, find and print string on a new line. If you'se able to form more than one valid string s print whichever one comes first alphabetically. if there is no waid answer, print instead.
Input Format
The first line convains a tingle integer, of denoting the number of quenes the subsequent fines descrite each query over two lines:
The first fine contains a sogle string denating a
The secono fine contains a single string denoung b
Constraims
lan
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
