This is a classic string manipulation. Since the given two strings are in alphabetical order already. So we just need to use three variables to mark the processed character, and the logic is shown below
The test cases will include the situation when the input contains exactly 100 valid lowercase characters.