Round 1
Questions:
Problem Statement: Given two strings, searchWord and resultWord:
Determine the minimum number of characters you need to append to resultWord so that it becomes a subsequence of searchWord.
Example:
Input: searchWord = "abcz", resultWord = "azdb"
Output: 2
Explanation: By appending 'd' and 'b' to "azdb", we can transform it into a subsequence of "abcz".
Understanding the Problem:
A subsequence of a string is derived by deleting some or no characters from it without changing the order of the remaining characters. For example:
- "ace" is a subsequence of "abcde" because 'a', 'c', and 'e' appear in order.
- "aec" is NOT a subsequence of "abcde" because 'e' appears before 'c'.
In this problem:
Input: Two strings, searchWord and resultWord.
Output: The number of characters to append to resultWord so that all characters in resultWord appear in order as a subsequence in searchWord.
First try yourself then see the actual approach it will help you to strong DSA problem solving skills
Explanation and Approach: Link to explanation
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.