Answer:
1. create the first array A
2. create the second array A1, the same length as array A.
3. create a loop to iterate over both arrays for a number of times specific to the length of the arrays, with a condition to get and pop only the minimum value of which arrays for every loop.
4. save both items to "a" for minimum value A and "b" for minimum value A1.
5. call a function to push the "a" variable value to A1 and "b" variable value to the array A.
Step-by-step explanation:
This code would interchange the values of both arrays, the best-case scenario for the code is O( n ) where n is the number of items in both arrays and worst is the best-case multiplied by the number of time to compare all the items with the minimum value.