Practice Interview Questions
| Question | Status |
|---|---|
Given two sorted lists of integers, write a function to merge them into a single sorted list. The input lists will already be sorted in ascending order. You need to return a new sorted list that contains all elements from both input lists.
Example:
Input:
list1 = [1, 3, 5, 7]
list2 = [2, 4, 6, 8]
Output:
[1, 2, 3, 4, 5, 6, 7, 8]
The two lists are merged into a single sorted list, which contains all elements from both lists in ascending order.