#C3262. Merge Alternating Characters
Merge Alternating Characters
Merge Alternating Characters
You are given two strings A and B. Your task is to merge them by alternating their characters, starting with the first character of A. If one string is exhausted before the other, simply append the remaining characters of the other string at the end.
This can be expressed mathematically as follows:
\[ \text{result} = \bigcup_{i=0}^{\min(|A|,|B|)-1} (A_i, B_i) \cup \text{remaining characters} \]
For example, if A = "abc" and B = "1234", then the result is "a1b2c34".
inputFormat
The input consists of two lines:
- The first line contains the string A.
- The second line contains the string B.
outputFormat
Output the merged string as per the described algorithm.
## sampleabc
1234
a1b2c34