Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 5 : Lazy String Problem Statement: Anish is the laziest person you can ever see. He is tasked to wrhe the name of the
Question : Lazy String
Problem Statement:
Anish is the laziest person you can ever see. He is tasked to wrhe the name of the winner in a game where two people take part. And he just writes the longest common subsequence over there, so that with minimum chane or no backspace he can edit the name to the winner's name.
For two given names, you have to predict what Anish will write in his computer before the start of the name. If there are more than two longest subsequences possible,write the one with less lexicographic value.
Input Format:
Two lines including two strings of nameAll with capital letters
Output Format:
A single line with the lexicographically smallest possible longest common subsequence.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started