Recursive interleaving of strings

The interleaving of two strings x and y is a string that contains all
characters of x and y and preserves the relative order of the characters
in both x and y. For example, the interleaving of abc and xyz is axbycz.
Write a program that prints the interleaving of every given pair of
strings.

Define and use a recursive function

    interleaving(x,y)

that returns the interleaving of two strings x and y.

Input

The input consists of several pairs of strings.

Output

Print the interleaving of every given pair of strings.

Problem information

Author: Gabriel Valiente

Generation: 2026-01-25T17:18:51.648Z

© Jutge.org, 2006–2026.
https://jutge.org
