일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 프로그래머스
- 109. Convert Sorted List to Binary Search Tree
- LeetCode
- Convert Sorted List to Binary Search Tree
- iterator
- DWG
- Python Implementation
- 파이썬
- 운영체제
- 30. Substring with Concatenation of All Words
- Generator
- Decorator
- Python
- t1
- 715. Range Module
- Class
- attribute
- 밴픽
- Substring with Concatenation of All Words
- Regular Expression
- Python Code
- 43. Multiply Strings
- concurrency
- Protocol
- kaggle
- shiba
- 315. Count of Smaller Numbers After Self
- 컴퓨터의 구조
- data science
- 시바견
Archives
- Today
- Total
목록25. Reverse Nodes in k-Group (1)
Scribbling
LeetCode: 25. Reverse Nodes in k-Group
Recursion solution. Time Complexity: O(N), Memory Complexity: O(1) # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reverseKGroup(self, head: Optional[ListNode], k: int) -> Optional[ListNode]: return self.helper(head, k) def helper(self, node, k): if not node: return None cur = node for i in ran..
Computer Science/Coding Test
2021. 8. 25. 22:55