solution

sorts all values until one array runs out of values, then terminates
while loop and will add remaining values from the larger array to result
before returning and then printing.