19. Remove Nth Node From End of List
Description: Given the head of a linked list, remove the nth node from the end of the list and return its head. # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next ''' [1] two pass) idea:: 1. get the length of linked list, let it len 2. delete len-n+1 th node code:: def removeNthFromEnd(self, head: Optional[ListNode],..
2021.11.12