일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 파이썬
- t1
- Regular Expression
- Protocol
- 시바견
- 밴픽
- iterator
- 운영체제
- 30. Substring with Concatenation of All Words
- Substring with Concatenation of All Words
- concurrency
- kaggle
- LeetCode
- Decorator
- Convert Sorted List to Binary Search Tree
- 프로그래머스
- Generator
- 109. Convert Sorted List to Binary Search Tree
- data science
- 315. Count of Smaller Numbers After Self
- shiba
- Python Implementation
- Python
- 컴퓨터의 구조
- attribute
- Python Code
- 715. Range Module
- DWG
- 43. Multiply Strings
- Class
Archives
- Today
- Total
목록82. Remove Duplicates from Sorted List II (1)
Scribbling
LeetCode: 82. Remove Duplicates from Sorted List II
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListNode]: if not head: return None new_head = ListNode() ptr = new_head reg, freq = head.val, 0 cur = head while cur != None: if reg != cur.val: if freq == 1: temp = ListNode(reg) ptr.n..
Computer Science/Coding Test
2021. 10. 6. 16:09