Interleaved String
Given two strings s0
and s1
, return the two strings interleaved, starting with s0
. If there are leftover characters in a string they should be added to the end.
Constraints
n ≤ 100,000
wheren
is the length ofs0
m ≤ 100,000
wheren
is the length ofs1
https://binarysearch.com/problems/Interleaved-String
Examples
Example 1
Input
- s0 =
abc
- s1 =
xyz
Output
- answer =
axbycz
Example 2
Input
- s0 =
abc
- s1 =
x
Output
- answer =
axbc
Leave a comment