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