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