일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Substring with Concatenation of All Words
- Regular Expression
- 715. Range Module
- 43. Multiply Strings
- Python
- 109. Convert Sorted List to Binary Search Tree
- Generator
- 파이썬
- 시바견
- data science
- 밴픽
- attribute
- Python Code
- Class
- iterator
- Protocol
- 315. Count of Smaller Numbers After Self
- 컴퓨터의 구조
- DWG
- 30. Substring with Concatenation of All Words
- kaggle
- 운영체제
- Python Implementation
- 프로그래머스
- concurrency
- LeetCode
- shiba
- t1
- Decorator
- Convert Sorted List to Binary Search Tree
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