일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 프로그래머스
- attribute
- 43. Multiply Strings
- Protocol
- Convert Sorted List to Binary Search Tree
- LeetCode
- concurrency
- data science
- shiba
- 715. Range Module
- Python Implementation
- DWG
- 315. Count of Smaller Numbers After Self
- Python Code
- 시바견
- Substring with Concatenation of All Words
- t1
- 파이썬
- Decorator
- 109. Convert Sorted List to Binary Search Tree
- kaggle
- Generator
- 컴퓨터의 구조
- 밴픽
- Python
- iterator
- Class
- Regular Expression
- 운영체제
Archives
- Today
- Total
목록143. Reorder List (1)
Scribbling
LeetCode: 143. Reorder List
Recursion을 이용한 방법 # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reorderList(self, head: Optional[ListNode]) -> None: """ Do not return anything, modify head in-place instead. """ cur = head count = 0 while cur != None: count += 1 cur = cur.next new_head, _ = self.helper(head, count) return ne..
Computer Science/Coding Test
2021. 11. 22. 10:49