Hello Mate,
Let's discuss problem statement.
We have two sorted array and we have to merge them with min complexity which will be O(n+n)
Input: [1,2,3,4,5,10,11,12],[2,6,7,8,9];
Output: [
1, 2, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11,
12
]
You can find code : https://gist.github.com/kewal28/77181...