← 返回 cisco 的题目列表Alternating String Merge
类型:qbank
Merge two lowercase strings by alternating characters from each string, then append the remaining suffix of the longer string.
Requirements
Input line 1 is strA.
Input line 2 is strB.
Append alternating characters from strA and strB into a new string.
Once one string is exhausted, append all remaining characters from the other string.
Constraint shown: 1 <= length(strA), length(strB) <= 25000.
Inputs contain no special characters or uppercase letters.
Examples
Input:
ab
zsd
Output:
azbsd
Explanation: alternate to form azbs, then append remaining d.
Notes
This is straightforward but output formatting is exact: print the merged string only.