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 1=["A","A","A"]
List 2=["B","B","B"]
Shuffled List =["A","B","A","B","A","B"]
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 1=["C","C","C","C"]
List 2=["D"]
Shuffled List =["C","D","C","C","C"]
Create a program that takes in two lists and returns the bridge-shuffled list.
Examples
["A","A","A"],["B","B","B"]["A","B","A","B","A","B"]
["C","C","C","C"],["D"]["C","D","C","C","C"]
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 1.
Sample Input 1
A A A
B B B
Sample Output 1
['A','B','A','B','A','B']
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!