Question: Problem Statement Create a program to bridge shuffle two lists. To bridge shuffle, you interleave the elements from the two lists in an alternating fashion,
Problem Statement
Create a program to bridge shuffle two lists. To bridge shuffle, you interleave the elements from the two lists in an alternating fashion, like so:
List AAA
List BBB
Shuffled List ABABAB
Bridge shuffle can also work with two lists of uneven length. We simply tack on the extra elements from the longer list, like so:
List CCCC
List D
Shuffled List CDCCC
Create a program that takes in two lists and returns the bridgeshuffled list.
Examples
AAABBBABABAB
CCCCDCDCCC
Notes
If the two input lists are of unequal length, add the additional elements of the longer list to the end of the shuffled list.
Always start your shuffle with the first element of List
Sample Input
A A A
B B B
Sample Output
ABABAB
This problem is derived from the Bridge Shuffle problem by Helen Yu modified for AutoGrader by John Henke.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
