Leetcode 19. Remove Nth Node From End of List (Python)

preview_player
Показать описание
Leetcode 19. Remove Nth Node From End of List (Python)

In this video, I solve Leetcode problem 19. Remove Nth Node From End of List in Python using two pointers.

You can find code on my (Ravina Gaikawad) GitHub repository. Find the link below.

If you have any algorithm problems you want me to solve please let me know in the comments below.

Ravina Gaikawad
Pseudocoder

#codinginterview #algorithm #leetcode #python #programming #faang #dsa #youtubevideo #pseudocoder #jumpgame #leetcodejumpgame #leetcode55 #leet_preparation_tips #leetcodesolution #leetcodequestionandanswers #ravinagaikawad
Рекомендации по теме
Комментарии
Автор

is my approach correct?

newNode=ListNode(0)
newNode=fast
newNode=slow
count=1
while fast != None:
fast=fast.next
count=count+1

for i in range(0, count-n):
slow=slow.next
slow.next=slow.next.next

return fast.next

AshikPasumarthi
Автор

if n=4 and length==6
it work i do'nt understand
slow.next=slow.next.next;
plz solve my doubt

Sukhraj-lu