Exercise 2: Interleaving
Practice interleaving elements of two arrays.
We'll cover the following
Given two strings of length 5, create an array of length 10 such that these two input strings appear as array elements in alternating positions.
Example
input_string_1 = "ha"
input_String_2 = "he"
result = ["ha", "he", "ha", "he", "ha", "he", "ha", "he", "ha", "he"]
Try it yourself
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy