Back to course home
0% completed
Vote For New Content
The counting version of this problem is easy, whereas the leetcode problem (http...
Shan
Jul 24, 2022
The counting version of this problem is easy, whereas the leetcode problem ( https://leetcode.com/problems/shortest-common-supersequence/ ) requires building the actual string. Using the DP table could help, can you provide the additional steps to build the output?
Side note: To reuse previous solutions, s1.length() + s2.length() - len(lcs_count) will also yield the expected solution. i.e. the LCS for Example 1 (btw mislabeled as Example 2) is "bcf" therefore 4 + 4 - 3 = 5. This also applies to Example 2: 7 + 11 - 3 because the LCS is "ami".
1
0
Comments
Comments
J
Junaid Effendi3 years ago
You are correct on the side note.
On this page