Tell me about how you would return an array by alternating elements from arrays A and B.
Implement alternate_arrays(a, b). Start with the first element of a, then take the first element of b, continuing while both arrays have elements. If one array is exhausted first, append the remaining elements from the other array in their original order.
Input: two lists of integers. Output: a new list containing all elements from both inputs.
def alternate_arrays(a, b):