Search
⌘K

Leetcode 1092. Shortest Common Supersequence

Find the shortest string that contains both input strings as subsequences — essentially merge them minimizing length by maximizing their overlap. This is solved by dynamic programming to compute the longest common subsequence and reconstruct the shortest common supersequence (O(n*m) time, where n and m ≤ 1000).

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late December, 2024

Google

Google

Mid-level

Shortest Common Supersequence

Comments

Your account is free and you can post anonymously if you choose.