Given 2 arrays arr1, arr2. Merge both the arrays in such a way that all the repeating elements occur consecutively.
Ex:
arr1[ ] = {1, 5,10, 5, 15, 4}
arr2[ ] = {4, 6, 35, 8, 2, 19, 2, 5, 0, 15}
O/P: res = {1, 5, 5, 5, 10, 15, 15, 4, 4, 6, 35, 8, 2, 2, 19, 0 }
Can somone help me with the logic and code for this in c++?