[LeetCode] 1092. Shortest Common Supersequence (Python)
·
알고리즘/LeetCode
난이도: HardProblem Description Given two strings str1 and str2, return the shortest string that has both str1 and str2 as subsequences. If there are multiple valid strings, return any of them. A string s is a subsequence of string t if deleting some number of characters from t (possibly 0) results in the string s. Problem ExampleExample 1:Input: str1 = "abac", str2 = "cab"Output: "cabac"Explanatio..