4

PROBLEM OF THE DAY: 28/08/2023 | Remove duplicate element from sorted Linked Lis...

 1 year ago
source link: https://www.geeksforgeeks.org/videos/problem-of-the-day-28082023-remove-duplicate-element-from-sorted-linked-list/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Remove duplicate element from sorted Linked List

August 29, 2023 |1.3K Views
PROBLEM OF THE DAY: 28/08/2023 | Remove duplicate element from sorted Linked List
Problem of the Day, Data Structures and Algorithms, linked-list
 Save  Share  3 Likes
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Devasish Khade. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Linked List but will also help you build up problem-solving skills.

In this video, we are given a singly linked list consisting of N nodes. The task is to remove duplicates (nodes with duplicate values) from the given list (if exists).
Note: Try not to use extra space. The nodes are arranged in a sorted way.

Example :

Input:
LinkedList: 2->2->4->5

Output: 2 4 5

Explanation: In the given linked list 2 ->2 -> 4-> 5, only 2 occurs more than 1 time. So we need to remove it once.

Give the problem a try before going through the video. All the best!!!

Problem Link: https://practice.geeksforgeeks.org/problems/remove-duplicate-element-from-sorted-linked-list/1

Solution IDE Link: https://ide.geeksforgeeks.org/online-python3-compiler/5816c636-3611-4071-a7fc-c77c99c3aec4

Read More

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK