#21 Merge Two Sorted Lists | Top Interview Questions | Ultimate Leetcode Challenge

Опубликовано: 18 Март 2026
на канале: Coders by Yutish
24
3

Merge Two Sorted Lists

Subscribe to my channel ---    / @codersbyyutish3249  

Link to Ultimate Leetcode Challenge Playlist ---    • Ultimate Leetcode Challenge  

Also checkout my playlist on Coding Interview Problems ---   • Coding Interview Problems for Beginners  

-------------------------------------------------------------------------------------------------------------------

Problem Statement - Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the first two lists.


Example 1:

Input: l1 = [1,2,4], l2 = [1,3,4]
Output: [1,1,2,3,4,4]

Example 2:

Input: l1 = [], l2 = []
Output: []

Example 3:

Input: l1 = [], l2 = [0]
Output: [0]


Constraints:

The number of nodes in both lists is in the range [0, 50].
Node.val = [-100, 100]
Both l1 and l2 are sorted in non-decreasing order.


Link to the problem --- https://leetcode.com/problems/merge-t...


#timeenthusiast​​ #ultimateleetcodechallenge​​ #leetcodeinhindi​ #topinterviewquestions #leetcode