You are given three strings s1, s2, and s3, all of equal length. Your task is to produce a new string by taking the characters column-wise: at each index i, first take s1[i], then s2[i], then s3[i], and concatenate them in that order.
Implement the function:
def interleave(s1: str, s2: str, s3: str) -> str:
...
1 <= len(s1) = len(s2) = len(s3) <= 10^5Input:
abc
def
ghi
Output:
adgbehcfi
Explanation: For index 0, we take 'a', 'd', 'g' → 'adg'; index 1 gives 'b', 'e', 'h' → 'beh'; index 2 gives 'c', 'f', 'i' → 'cfi'. Concatenating these yields 'adgbehcfi'.
s1 = abc s2 = def s3 = ghi
adgbehcfi
We start with three strings of equal length: s1 = 'abc', s2 = 'def', s3 = 'ghi'.
s1 = abc s2 = def s3 = ghi
adgbehcfi
We start with three strings of equal length: s1 = 'abc', s2 = 'def', s3 = 'ghi'.