This video is about Delete duplicate-value nodes from a sorted linked list
Problem Statement:
You're given the pointer to the head node of a sorted linked list, where the data in the nodes is in ascending order. Delete as few nodes as possible so that the list does not contain any value more than once. The given head pointer may be null indicating that the list is empty.
#DataStructure #HackerRank #LinkedList #Interview
Problem:
https://www.hackerrank.com/challenges/delete-duplicate-value-nodes-from-a-sorted-linked-list/problem
Code Sample:
def removeDuplicates(head):
ptr=head
while ptr.next is not None:
if ptr.data==ptr.next.data:
ptr.next=ptr.next.next
continue
ptr=ptr.next
return head
Linear Linked List in detail
Part-1. https://youtu.be/9cF71KQz9xo
Part-2. https://youtu.be/carct0qNuf0
Part-3. https://youtu.be/hNRhZLnQKBE
Part-4. https://youtu.be/1IaOtf6NSs8
For 1 : 1 Tutoring
WhatsApp contact : 7278222619
mail: [email protected]
You can support via UPI : sattujaiswal@okhdfcbank
Follow me on:
Whatsapp:
https://chat.whatsapp.com/LNwHGukUizjJPAxK7ma8gs
Facebook:
https://www.facebook.com/coderscart/
Linkedin:
https://www.linkedin.com/in/satyendra-jaiswal-903588a2/
Instagram:
https://www.instagram.com/codingcart/