
[LeetCode] 21. Merge Two Sorted Lists, Easy
·
CodingTest/LeetCode
1. 문제두 단일 연결 리스트가 정렬된 채로 주어질 때, 오름차순으로 정렬된 1개의 단일 연결리스트를 반환하라./** * Definition for singly-linked list. * class ListNode { * val: number * next: ListNode | null * constructor(val?: number, next?: ListNode | null) { * this.val = (val===undefined ? 0 : val) * this.next = (next===undefined ? null : next) * } * } */function mergeTwoLists(list1: ListNode | null, list2: ..