From a1666d5069b9f5d0dc026e619e7de2c6deee6efa Mon Sep 17 00:00:00 2001 From: BangDori Date: Mon, 6 Jan 2025 20:50:28 +0900 Subject: [PATCH] [Leetcode - Easy] Merge Two Sorted Lists --- bangdori/Merge Two Sorted Lists.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bangdori/Merge Two Sorted Lists.js b/bangdori/Merge Two Sorted Lists.js index a338c97..72f5de2 100644 --- a/bangdori/Merge Two Sorted Lists.js +++ b/bangdori/Merge Two Sorted Lists.js @@ -29,12 +29,7 @@ var mergeTwoLists = function (list1, list2) { list = list.next; } - if (!list1) { - list.next = list2; - } - if (!list2) { - list.next = list1; - } + list.next = list1 || list2; return head.next; };