Company: Ion group_4nov
Difficulty: medium
Longest Subsequence Problem Description Determine the maximum length of a subsequence from one string that is also a substring of another string. A subsequence of a string is created by removing zero or more characters from it, while a substring consists of consecutive characters from the string. Given two strings x and y , determine the length of the longest subsequence of x that is also a substring of y . For example, if x = 'abcod' and y = 'abdc' : Subsequences of 'abcod' include 'a' , 'b' , 'c' , 'o' , 'd' , 'ab' , 'ac' , 'ad' , 'abc' , 'abd' , etc. Substrings of 'abdc' include 'a' , 'b' , 'd' , 'c' , 'ab' , 'bd' , 'dc' , 'abd' , 'bdc' , 'abdc' . The longest subsequence of x that is also a substring of y is 'abd' with length 3. Complete the function longestSubsequence in the editor. The function is expected to return an INTEGER . The function accepts the following parameters: string x : a string to find the subsequence of string y : a string to find the substring of The function si