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