Question: You have two strings, a and b . Find a string, s , such that: substring af b . s is a palindromic sinis .
You have two strings, a and Find a string, s such that: substring af b
s is a palindromic sinis
The length of s is as lorg as possible.
For each of the pairs of strings and : fetencd as inpu, find and pent gring on a new lne if you'te able to form more than one vald string print whichever one comes first aphabetically if there is no valid answer, print rntead.
input Format: aiatry over two lnes:
the shesend lire contans a singie waring decoting
Constraints
a ane b contain only bowercace frigithi intien.
Sum of a aver al que
res does nec exreed
give code in c
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
