Skip to content
Advertisement

I am merging to list with ascending order

If either i or j reach the end of their list range, how i copy the remainder of the other list to the merge list https://ibb.co/m9JzBYp go to link if not get the question

JavaScript

Advertisement

Answer

EDIT – OP wanted the code in some specific way.. Please see second snippet.

Don’t try to complicate your code.. just go with how you would do it manually and write the code.

JavaScript

Output

JavaScript

What OP needed

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement