update 21

This commit is contained in:
sangge-rockpi 2024-01-20 22:41:52 +08:00
parent 579e90ba94
commit 57ea9b4bb5

13
leetcode/21.py Normal file
View File

@ -0,0 +1,13 @@
# Merge Two Sorted Lists
# Definition for singly-linked list
# class ListNode:
# def __init__(self, val = 0, next = None):
# self.val = val
# self.next = next
class Solution:
def mergeTwoLists(self, list1: list, list2: list):
new_list = list1 + list2
return new_list.sort()