Question: Write the function in the python and show me the code thx! 3. Write a function 1cs(s1, s2) that takes two strings s1 and s2
3. Write a function 1cs(s1, s2) that takes two strings s1 and s2 and returns the longest common subsequence (LCS) that they share. The LCS is a string whose letters appear in both s1 and s2; these letters must appear in the same order in both sl and s2, but not necessarily consecutively. For example: 1cs('human', 'chimp') hm # 'h' comes before 'm' in both string 1csC'gattaca', 'tacgaacta') gaaca' >1cs('wow', 'whew') 1cswhew') # first string is empty 'efghabed') 'efgh' would also be fine >>> 1cs('abcdefgh', abcd # tie
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
