less than 1 minute read

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 where n is the length of s0
  • m ≤ 100,000 where n is the length of s1

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

Solution

Leave a comment