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