Question: Given a string without spaces, the task is to remove duplicates from it. Note: The original order of characters must be kept the same. Example

 Given a string without spaces, the task is to remove duplicates

Given a string without spaces, the task is to remove duplicates from it. Note: The original order of characters must be kept the same. Example 1: Input: S = "geeksforGeeks" Output: geksfor Explanation: Only keep the first occurrence Example 2: Input: S = "gfg" Output: gf Explanation: Only keep the first occurrence Your task: Your task is to complete the function removeDups() which takes a single string as input and returns the string. You need not take any input or print anything

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!