Merge 2 sorted Arrays Inplace (JavaScript)

Time complexity: O(n)
Here n represents the sum of the lengths of both the arrays.

Code

Output

Demo