You’re given two strings, source and target, made up of lowercase English letters. Your task is to determine the minimum number of characters that must be appended to the end of the source so that the target becomes a subsequence of the resulting string.
Note: A subsequence is formed by deleting zero or more characters from a string without changing the order of the remaining characters.
Constraints:
source.length, target.length
source and target consist only of lowercase English letters.
Let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Append Characters to String to Make Subsequence
Given source = "axbyc" and target = "abcde".
What is the minimum number of characters to append so the target becomes a subsequence?
1
3
2
4
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding on how to solve this problem.
Implement your solution in the following coding playground.
You’re given two strings, source and target, made up of lowercase English letters. Your task is to determine the minimum number of characters that must be appended to the end of the source so that the target becomes a subsequence of the resulting string.
Note: A subsequence is formed by deleting zero or more characters from a string without changing the order of the remaining characters.
Constraints:
source.length, target.length
source and target consist only of lowercase English letters.
Let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Append Characters to String to Make Subsequence
Given source = "axbyc" and target = "abcde".
What is the minimum number of characters to append so the target becomes a subsequence?
1
3
2
4
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding on how to solve this problem.
Implement your solution in the following coding playground.