4
How to merge an array by replacing the equal numbers ?
Example:
array1 = [1, 2, 3];
array2 = [2, 4, 5];
array3 would be [1, 2, 3, 4, 5];
instead of [1, 2, 2, 3, 4, 5];
How to merge an array by substituting equal numbers only in odd arrays ? (same thing from the top question but only in odd boxes)
Example 1:
array1 = [1, 1, 2];
array2 = [3, 4, 6];
array3 would be [1, 2, 3, 6];
Example 2:
array1 = [4, 1, 5];
array2 = [4, 4, 3];
array3 would be [4, 5, 3];
Your second question is unclear
– Papa Charlie
The second I didn’t understand !!!?
– Maria
I updated the answer with the solution. Separate the KEYS into odd and even.
– Papa Charlie