Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 432 Bytes

merging_reversed_lists.markdown

File metadata and controls

26 lines (17 loc) · 432 Bytes

Merging Reversed Lists

Assume you have two lists that are each reverse sorted:

[10, 9, 6, 3, 1]
[8, 6, 5, 2]

Write an algorithm to merge them into a single ascending list:

[1, 2, 3, 5, 6, 6, 8, 9, 10]

Restrictions

Don't use any of the following:

  • .reverse
  • .sort or .sort_by
  • negative array indicies, .last, or .pop

Timing

Try to complete this challenge with tests in under 20 minutes.