일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 30. Substring with Concatenation of All Words
- Substring with Concatenation of All Words
- 컴퓨터의 구조
- concurrency
- 밴픽
- kaggle
- attribute
- 프로그래머스
- t1
- Decorator
- 운영체제
- 파이썬
- Class
- Python Implementation
- Protocol
- shiba
- Python
- iterator
- data science
- Regular Expression
- DWG
- 109. Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- 715. Range Module
- Python Code
- 시바견
- Convert Sorted List to Binary Search Tree
- LeetCode
- Generator
- 315. Count of Smaller Numbers After Self
Archives
- Today
- Total
목록21. Merge Two Sorted Lists (1)
Scribbling
LeetCode: 21. Merge Two Sorted Lists
Use dummy head to simplify code. # 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, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]: dummy_head = ListNode() cur, p1, p2 = dummy_head, l1, l2 while p1 != None and p2 != None: if p1.val
Computer Science/Coding Test
2022. 1. 5. 11:51