def interleave(s, t, res, i, j, lis):
    if i == len(s) and j == len(t):
        lis.append(res)
return
if i < len(s):
    interleave(s, t, res + s[i], i + 1, j, lis)
if j < len(t):
    interleave(s, t, res + t[j], i, j + 1, lis)
l = []
s = 'ab'
t = 'cd'
interleave(s, t, '', 0, 0, l)
print(l)
All possible ways to interleave two strings