15 - Shortest Common Supersequence - Dynamic Programming Approach 1
@Rishi Srivastava
Example 1:
Input: str1 = “abac“, str2 = “cab“
Output: “cabac“
1) Find Longest Common Subsequence (LCS) of two given strings. For example, LCS of “abac” and “cab” is “ab”.
2) Insert non-LCS characters (in their original order in strings) to the LCS found above, and return the result. So “ab” becomes “cabac” which is shortest common supersequence.
Github:
Leetcode:
1 view
1605
544
6 days ago 00:24:25 1
Это опасное растение захватило уже все континенты, кроме Антарктиды. И остановить его невозможно