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 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
Get step-by-step solutions from verified subject matter experts
