Remove nth node from end of the list | Technical Interview question | leetcode 19

preview_player
Показать описание
Please like the video, this really motivates us to make more such videos and helps us to grow. thecodingworld is a community which is formed to help fellow student and professionals looking to crack the “coding interviews”.

We love solving and sharing problems which are frequently asked in technical interviews and voted by community at various websites.

✅ For more and upcoming updates join our community

#leetcode #python
Рекомендации по теме
Комментарии
Автор

Please upload and more videoes becz there isn't a proper channel for python

Shivi
Автор

did we return the head of the nth node?

arbaazali
Автор

Nice code..thanks.
This program if we want to run on VS code then we have to send link list like
lst = Solution()
head = Node(4, Node(23, Node(4, Node(8, # [4, 23, 4, 8, 1]
new_head = lst.remove_element_from_last(head, 1)
while new_head:
print(new_head.value, end=" ")
new_head = new_head.next

because it is failing with AttributeError: 'list' object has no attribute 'next' if we send list like [4, 23, 4, 8, 1]

Please correct me if I am not right?

sumantwankhede
Автор

not a good explanation bt really good code

SnapSHORT
Автор

You have a working solution, but I am missing the "Why". Why does this work? Unless we dont understand the 'why' we will not be able to come up with this again.

cloud
Автор

I am not very well versed with Linked list but we are editing fast and slow but why are we returning head? Aren't we returning the unedited list? (I know we are not)

yasirmalik